Home
last modified time | relevance | path

Searched refs:connection (Results 1 – 16 of 16) sorted by relevance

/libcore/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/https/
DHttpsURLConnectionTest.java140 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in testHttpsConnection() local
141 connection.setSSLSocketFactory(ctx.getSocketFactory()); in testHttpsConnection()
144 executeClientRequest(connection, false /* doOutput */); in testHttpsConnection()
146 checkConnectionStateParameters(connection, dispatcher.getLastRequest()); in testHttpsConnection()
149 connection.connect(); in testHttpsConnection()
173 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in testHttpsConnection_Not_Found_Response() local
174 connection.setSSLSocketFactory(ctx.getSocketFactory()); in testHttpsConnection_Not_Found_Response()
177 executeClientRequest(connection, false /* doOutput */); in testHttpsConnection_Not_Found_Response()
187 connection.connect(); in testHttpsConnection_Not_Found_Response()
218 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in testSetDefaultSSLSocketFactory() local
[all …]
/libcore/luni/src/test/java/libcore/java/net/
DURLConnectionTest.java344 HttpURLConnection connection = (HttpURLConnection) server.getUrl("/").openConnection(); in getErrorStreamOnSuccessfulRequest() local
345 assertNull(connection.getErrorStream()); in getErrorStreamOnSuccessfulRequest()
351 HttpURLConnection connection = (HttpURLConnection) server.getUrl("/").openConnection(); in getErrorStreamOnUnsuccessfulRequest() local
352 assertEquals("A", readAscii(connection.getErrorStream())); in getErrorStreamOnUnsuccessfulRequest()
560 HttpsURLConnection connection = (HttpsURLConnection) server.getUrl("/foo").openConnection(); in checkConnectViaHttps() local
561 connection.setSSLSocketFactory(testSSLContext.clientContext.getSocketFactory()); in checkConnectViaHttps()
563 assertContent("this response comes via HTTPS", connection); in checkConnectViaHttps()
579 HttpsURLConnection connection = (HttpsURLConnection) server.getUrl("/").openConnection(); in connectViaHttpsReusingConnections() local
580 connection.setSSLSocketFactory(clientSocketFactory); in connectViaHttpsReusingConnections()
581 assertContent("this response comes via HTTPS", connection); in connectViaHttpsReusingConnections()
[all …]
DFtpURLConnectionTest.java92 URLConnection connection = fileUrl.openConnection(); in testInputUrl() local
93 assertContents(fileContents, connection.getInputStream()); in testInputUrl()
114 URLConnection connection = fileUrl.openConnection(); in checkInputUrl_invalidUserOrPassword() local
116 connection.getInputStream(); in checkInputUrl_invalidUserOrPassword()
129 URLConnection connection = fileUrl.openConnection(); in testOutputUrl() local
130 connection.setDoInput(false); in testOutputUrl()
131 connection.setDoOutput(true); in testOutputUrl()
132 OutputStream os = connection.getOutputStream(); in testOutputUrl()
142 URLConnection connection = fileUrl.openConnection(proxy); in testConnectOverProxy_noProxy() local
143 assertContents(fileContents, connection.getInputStream()); in testConnectOverProxy_noProxy()
[all …]
DOldJarURLConnectionTest.java162 JarURLConnection connection = (JarURLConnection) url.openConnection(); in test_getJarFile() local
164 connection.connect(); in test_getJarFile()
171 connection.getJarFile(); in test_getJarFile()
231 JarURLConnection connection = (JarURLConnection) url.openConnection(); in test_setUseCaches() local
232 connection.setUseCaches(false); in test_setUseCaches()
233 connection.getInputStream(); in test_setUseCaches()
234 InputStream in = connection.getInputStream(); in test_setUseCaches()
235 JarFile jarFile1 = connection.getJarFile(); in test_setUseCaches()
236 JarEntry jarEntry1 = connection.getJarEntry(); in test_setUseCaches()
239 JarFile jarFile2 = connection.getJarFile(); in test_setUseCaches()
[all …]
DURLStreamHandlerFactoryTest.java60 URLConnection connection = url.openConnection(); in testCreateURLStreamHandler() local
61 assertTrue(connection instanceof Handler.HandlerURLConnection); in testCreateURLStreamHandler()
93 URLConnection connection = new URL("http://android.com/").openConnection(); in testInstallCustomProtocolHandler() local
94 assertTrue(connection instanceof Handler.HandlerURLConnection); in testInstallCustomProtocolHandler()
DOldCookieHandlerTest.java69 URLConnection connection = server.getUrl("/path/foo").openConnection(); in test_get_put() local
70 connection.getContent(); in test_get_put()
DAbstractCookiesTest.java418 HttpURLConnection connection = (HttpURLConnection) server.getUrl("/").openConnection(); in testHeadersSentToCookieHandler() local
420 connection.getRequestProperties()); in testHeadersSentToCookieHandler()
422 connection.setRequestProperty("Foo", "foo"); in testHeadersSentToCookieHandler()
423 connection.setDoOutput(true); in testHeadersSentToCookieHandler()
424 connection.getOutputStream().write(5); in testHeadersSentToCookieHandler()
425 connection.getOutputStream().close(); in testHeadersSentToCookieHandler()
426 connection.getInputStream().close(); in testHeadersSentToCookieHandler()
441 assertContainsAll(connection.getRequestProperties().keySet(), "Foo"); in testHeadersSentToCookieHandler()
442 assertContainsAll(connection.getRequestProperties().keySet(), in testHeadersSentToCookieHandler()
444 assertContainsAll(connection.getRequestProperties().keySet(), "Cookie", "Cookie2"); in testHeadersSentToCookieHandler()
[all …]
/libcore/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/
DHttpURLConnectionTest.java193 HttpURLConnection connection = (HttpURLConnection) url in testUsingProxy() local
197 connection.setConnectTimeout(2000); in testUsingProxy()
198 connection.setReadTimeout(2000); in testUsingProxy()
209 connection.connect(); in testUsingProxy()
215 assertTrue("Connection does not use proxy", connection.usingProxy()); in testUsingProxy()
240 HttpURLConnection connection = in testUsingProxySelector() local
242 connection.setConnectTimeout(2000); in testUsingProxySelector()
243 connection.setReadTimeout(2000); in testUsingProxySelector()
253 connection.connect(); in testUsingProxySelector()
260 connection.usingProxy()); in testUsingProxySelector()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/
DHttpsURLConnectionTest.java66 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in test_getCipherSuite() local
68 connection.getCipherSuite(); in test_getCipherSuite()
82 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in test_getLocalCertificates() local
84 connection.getLocalCertificates(); in test_getLocalCertificates()
124 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in test_getLocalPrincipal() local
126 connection.getLocalPrincipal(); in test_getLocalPrincipal()
142 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in test_getPeerPrincipal() local
144 connection.getPeerPrincipal(); in test_getPeerPrincipal()
165 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in test_getServerCertificates() local
167 connection.getServerCertificates(); in test_getServerCertificates()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/
DJarURLConnectionTest.java101 JarURLConnection connection = null; in test_getJarFile() local
102 connection = (JarURLConnection) url.openConnection(); in test_getJarFile()
104 connection.connect(); in test_getJarFile()
111 connection.getJarFile(); in test_getJarFile()
163 JarURLConnection connection = (JarURLConnection) url.openConnection(); in test_setUseCaches() local
164 connection.setUseCaches(false); in test_setUseCaches()
165 InputStream in = connection.getInputStream(); in test_setUseCaches()
166 JarFile jarFile1 = connection.getJarFile(); in test_setUseCaches()
167 JarEntry jarEntry1 = connection.getJarEntry(); in test_setUseCaches()
172 JarFile jarFile2 = connection.getJarFile(); in test_setUseCaches()
[all …]
/libcore/ojluni/src/main/java/sun/security/provider/certpath/
DURICertStore.java277 URLConnection connection = uri.toURL().openConnection(); in engineGetCertificates() local
279 connection.setIfModifiedSince(lastModified); in engineGetCertificates()
282 try (InputStream in = connection.getInputStream()) { in engineGetCertificates()
283 lastModified = connection.getLastModified(); in engineGetCertificates()
290 } else if (connection instanceof HttpURLConnection) { in engineGetCertificates()
292 HttpURLConnection hconn = (HttpURLConnection)connection; in engineGetCertificates()
390 URLConnection connection = uri.toURL().openConnection(); in engineGetCRLs() local
392 connection.setIfModifiedSince(lastModified); in engineGetCRLs()
395 connection.setConnectTimeout(CRL_CONNECT_TIMEOUT); in engineGetCRLs()
396 try (InputStream in = connection.getInputStream()) { in engineGetCRLs()
[all …]
/libcore/benchmarks/src/benchmarks/regression/
DHostnameVerifierBenchmark.java55 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); in setUp() local
56 connection.setHostnameVerifier(new HostnameVerifier() { in setUp()
67 connection.getInputStream(); in setUp()
68 connection.disconnect(); in setUp()
DURLConnectionBenchmark.java81 HttpURLConnection connection = (HttpURLConnection) url.openConnection(); in get() local
83 InputStream in = connection.getInputStream(); in get()
/libcore/luni/src/test/java/libcore/libcore/net/http/
DHttpURLConnectionFactoryTest.java63 final URLConnection connection = factory.openConnection(url, SocketFactory.getDefault(), in testOpenConnection() local
65 assertEquals(connection.getURL(), url); in testOpenConnection()
/libcore/ojluni/src/main/java/java/util/
DResourceBundle.java2665 URLConnection connection = url.openConnection(); in newBundle()
2666 if (connection != null) { in newBundle()
2669 connection.setUseCaches(false); in newBundle()
2670 is = connection.getInputStream(); in newBundle()
2817 URLConnection connection = url.openConnection(); in needsReload() local
2818 if (connection != null) { in needsReload()
2820 connection.setUseCaches(false); in needsReload()
2821 if (connection instanceof JarURLConnection) { in needsReload()
2822 JarEntry ent = ((JarURLConnection)connection).getJarEntry(); in needsReload()
2830 lastModified = connection.getLastModified(); in needsReload()
/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/net/
DURLConnectionTest.java289 HttpURLConnection connection = (HttpURLConnection)
293 connection.setDoOutput(true);
294 OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
297 assertEquals(200, connection.getResponseCode());
298 connection.disconnect();
1093 URLConnection connection = url.openConnection();
1099 connection.setIfModifiedSince(sinceTime);
1100 assertEquals("Wrong date set", sinceTime, connection