Lines Matching defs:connection

88     // read/connection timeout value
138 // create url connection to be tested
140 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
141 connection.setSSLSocketFactory(ctx.getSocketFactory());
144 executeClientRequest(connection, false /* doOutput */);
146 checkConnectionStateParameters(connection, dispatcher.getLastRequest());
149 connection.connect();
155 * Tests the behaviour of HTTPS connection in case of unavailability of requested resource.
171 // create url connection to be tested
173 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
174 connection.setSSLSocketFactory(ctx.getSocketFactory());
177 executeClientRequest(connection, false /* doOutput */);
187 connection.connect();
218 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
220 // late initialization: this HostnameVerifier should not be used for created connection
225 executeClientRequest(connection, false /* doOutput */);
226 checkConnectionStateParameters(connection, dispatcher.getLastRequest());
235 connection.getSSLSocketFactory());
258 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
260 // late initialization: should not be used for the created connection.
262 connection.setSSLSocketFactory(socketFactory);
264 // late initialization: should not be used for created connection
269 executeClientRequest(connection, false /* doOutput */);
270 checkConnectionStateParameters(connection, dispatcher.getLastRequest());
278 connection.getSSLSocketFactory());
279 assertSame("Result differs from expected", socketFactory, connection.getSSLSocketFactory());
286 * of the connection state parameters before connection has been made.
291 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
294 connection.getCipherSuite();
298 connection.getPeerPrincipal();
302 connection.getLocalPrincipal();
307 connection.getServerCertificates();
311 connection.getLocalCertificates();
334 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
335 connection.setSSLSocketFactory(getContext().getSocketFactory());
339 connection.setHostnameVerifier(connectionHostnameVerifier);
342 executeClientRequest(connection, false /* doOutput */);
347 checkConnectionStateParameters(connection, dispatcher.getLastRequest());
370 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
371 connection.setSSLSocketFactory(getContext().getSocketFactory());
374 executeClientRequest(connection, true /* doOutput */);
375 checkConnectionStateParameters(connection, dispatcher.getLastRequest());
378 connection.connect();
384 * Tests HTTPS connection process made through the proxy server.
409 HttpsURLConnection connection = (HttpsURLConnection)
411 connection.setSSLSocketFactory(getContext().getSocketFactory());
414 executeClientRequest(connection, false /* doOutput */);
415 checkConnectionStateParameters(connection, getDispatcher.getLastRequest());
418 connection.connect();
424 * Tests HTTPS connection process made through the proxy server.
458 HttpsURLConnection connection = (HttpsURLConnection)
460 connection.setSSLSocketFactory(getContext().getSocketFactory());
463 executeClientRequest(connection, false /* doOutput */);
464 checkConnectionStateParameters(connection, getDispatcher.getLastRequest());
467 connection.connect();
473 * Tests HTTPS connection process made through the proxy server.
474 * Two HTTPS connections are opened for one URL: the first time the connection is opened
492 HttpsURLConnection connection = (HttpsURLConnection)
494 connection.setSSLSocketFactory(getContext().getSocketFactory());
495 executeClientRequest(connection, false /* doOutput */);
496 checkConnectionStateParameters(connection, getDispatcher1.getLastRequest());
530 * Tests HTTPS connection process made through the proxy server.
564 HttpsURLConnection connection = (HttpsURLConnection)
566 connection.setSSLSocketFactory(getContext().getSocketFactory());
569 executeClientRequest(connection, true /* doOutput */);
570 checkConnectionStateParameters(connection, postDispatcher.getLastRequest());
573 connection.connect();
579 * Tests HTTPS connection process made through the proxy server.
600 HttpsURLConnection connection = (HttpsURLConnection)
602 connection.setSSLSocketFactory(getContext().getSocketFactory());
606 executeClientRequest(connection, false);
616 * Tests the behaviour of HTTPS connection in case of unavailability of requested resource (as
641 HttpsURLConnection connection = (HttpsURLConnection)
643 connection.setSSLSocketFactory(getContext().getSocketFactory());
646 executeClientRequest(connection, false /* doOutput */);
691 HttpsURLConnection connection, RecordedRequest request) throws Exception {
692 assertEquals(request.getSslCipherSuite(), connection.getCipherSuite());
693 assertEquals(request.getSslLocalPrincipal(), connection.getPeerPrincipal());
694 assertEquals(request.getSslPeerPrincipal(), connection.getLocalPrincipal());
696 Certificate[] serverCertificates = connection.getServerCertificates();
701 localCertificates = connection.getLocalCertificates();
952 * Executes an HTTP request using the supplied connection. If {@code doOutput} is {@code true}
958 HttpsURLConnection connection, boolean doOutput) throws IOException {
960 // set up the connection
961 connection.setDoInput(true);
962 connection.setConnectTimeout(TIMEOUT);
963 connection.setReadTimeout(TIMEOUT);
964 connection.setDoOutput(doOutput);
966 log("Client", "Opening the connection to " + connection.getURL());
967 connection.connect();
968 log("Client", "Connection has been ESTABLISHED, using proxy: " + connection.usingProxy());
971 // connection configured to post data, do so
972 OutputStream os = connection.getOutputStream();
976 InputStream is = connection.getInputStream();
987 log("Client", "Response code: " + connection.getResponseCode());