Home | History | Annotate | Download | only in framed

Lines Matching defs:connection

77   protected HttpURLConnection connection;
100 connection = client.open(server.getUrl("/foo"));
101 assertContent("ABCDE", connection, Integer.MAX_VALUE);
102 assertEquals(200, connection.getResponseCode());
103 assertEquals("Sweet", connection.getResponseMessage());
114 connection = client.open(server.getUrl("/foo"));
115 assertEquals(-1, connection.getInputStream().read());
123 connection = client.open(server.getUrl("/foo"));
124 connection.setDoOutput(true);
125 connection.setChunkedStreamingMode(0);
126 connection.getOutputStream().write(postBytes);
127 assertContent("ABCDE", connection, Integer.MAX_VALUE);
138 connection = client.open(server.getUrl("/foo"));
139 connection.setRequestProperty("Content-Length", String.valueOf(postBytes.length));
140 connection.setDoOutput(true);
141 connection.getOutputStream().write(postBytes);
142 assertContent("ABCDE", connection, Integer.MAX_VALUE);
153 connection = client.open(server.getUrl("/foo"));
154 connection.setRequestProperty("Content-Length", String.valueOf(postBytes.length));
155 connection.setDoOutput(true);
156 connection.getOutputStream().write(postBytes); // push bytes into SpdyDataOutputStream.buffer
157 connection.getOutputStream().flush(); // FramedConnection.writeData subject to write window
158 connection.getOutputStream().close(); // FramedConnection.writeData empty frame
159 assertContent("ABCDE", connection, Integer.MAX_VALUE);
170 connection = client.open(server.getUrl("/foo"));
171 connection.setFixedLengthStreamingMode(postBytes.length);
172 connection.setDoOutput(true);
173 connection.getOutputStream().write(postBytes);
174 assertContent("ABCDE", connection, Integer.MAX_VALUE);
222 connection = client.open(server.getUrl("/"));
223 assertEquals("Successful auth!", readAscii(connection.getInputStream(), Integer.MAX_VALUE));
239 connection = client.open(server.getUrl("/"));
240 assertContent("This is the new location!", connection, Integer.MAX_VALUE);
251 connection = client.open(server.getUrl("/"));
252 InputStream in = connection.getInputStream();
263 connection = client.open(server.getUrl("/"));
264 connection.setReadTimeout(1000);
265 assertContent("A", connection, Integer.MAX_VALUE);
278 server.enqueue(new MockResponse().setBody(new String(body)).throttleBody(1024, 1, SECONDS)); // slow connection 1KiB/second
280 connection = client.open(server.getUrl("/"));
281 connection.setReadTimeout(2000); // 2 seconds to read something.
282 assertContent(new String(body), connection, Integer.MAX_VALUE);
297 .throttleBody(1024, 1, SECONDS)); // slow connection 1KiB/second
299 connection = client.open(server.getUrl("/"));
300 connection.setReadTimeout(500); // half a second to read something
301 connection.connect();
303 readAscii(connection.getInputStream(), Integer.MAX_VALUE);
403 // Disconnect before the stream is created. A connection is still established!
408 // That connection is pooled, and it works.
415 void assertContent(String expected, HttpURLConnection connection, int limit)
417 connection.connect();
418 assertEquals(expected, readAscii(connection.getInputStream(), limit));