Home
last modified time | relevance | path

Searched refs:server (Results 1 – 25 of 34) sorted by relevance

12

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/
DSocketTest.java123 ServerThread server = new ServerThread(); in connectTestImpl() local
124 server.serverSocketConstructor = ssConsType; in connectTestImpl()
125 Thread serverThread = new Thread(server); in connectTestImpl()
127 server.waitCreated(); in connectTestImpl()
189 ServerSocket server = new ServerSocket(); in test_bindLjava_net_SocketAddress() local
190 server.bind(theAddress); in test_bindLjava_net_SocketAddress()
191 int sport = server.getLocalPort(); in test_bindLjava_net_SocketAddress()
196 Socket worker = server.accept(); in test_bindLjava_net_SocketAddress()
203 server.close(); in test_bindLjava_net_SocketAddress()
261 ServerSocket server = new ServerSocket(0); in test_close() local
[all …]
DDatagramSocketTest.java205 DatagramServer server = new DatagramServer(Inet6Address.LOOPBACK)) { in testConnect_echoServer()
206 server.start(); in testConnect_echoServer()
208 ds.connect(Inet6Address.LOOPBACK, server.getPort()); in testConnect_echoServer()
243 DatagramServer server = new DatagramServer(Inet6Address.LOOPBACK); in testConnect_connectDisconnectConnectThenSendRecv()
245 server.start(); in testConnect_connectDisconnectConnectThenSendRecv()
248 final int serverPortNumber = server.getPort(); in testConnect_connectDisconnectConnectThenSendRecv()
268 DatagramServer server = new DatagramServer(Inet6Address.LOOPBACK)) { in testConnect_connectDisconnectThenSendRecv()
269 server.start(); in testConnect_connectDisconnectThenSendRecv()
271 final int serverPortNumber = server.getPort(); in testConnect_connectDisconnectThenSendRecv()
290 DatagramServer server = new DatagramServer(Inet6Address.LOOPBACK); in testConnect_connectTwice()
[all …]
/libcore/luni/src/test/java/libcore/libcore/net/
DNetworkSecurityPolicyTest.java99 try (CapturingServerSocket server = new CapturingServerSocket()) { in testCleartextTrafficPolicyWithHttpURLConnection() argument
100 URL url = new URL("http://localhost:" + server.getPort() + "/test.txt"); in testCleartextTrafficPolicyWithHttpURLConnection()
106 server.assertDataTransmittedByClient(); in testCleartextTrafficPolicyWithHttpURLConnection()
112 try (CapturingServerSocket server = new CapturingServerSocket()) { in testCleartextTrafficPolicyWithHttpURLConnection() argument
113 URL url = new URL("http://localhost:" + server.getPort() + "/test.txt"); in testCleartextTrafficPolicyWithHttpURLConnection()
119 server.assertNoDataTransmittedByClient(); in testCleartextTrafficPolicyWithHttpURLConnection()
127 try (CapturingServerSocket server = new CapturingServerSocket(serverReplyOnConnect)) { in testCleartextTrafficPolicyWithFtpURLConnection() argument
128 URL url = new URL("ftp://localhost:" + server.getPort() + "/test.txt"); in testCleartextTrafficPolicyWithFtpURLConnection()
134 server.assertDataTransmittedByClient(); in testCleartextTrafficPolicyWithFtpURLConnection()
140 try (CapturingServerSocket server = new CapturingServerSocket(serverReplyOnConnect)) { in testCleartextTrafficPolicyWithFtpURLConnection() argument
[all …]
/libcore/luni/src/test/java/libcore/java/net/
DOldCookieHandlerTest.java33 private MockWebServer server; field in OldCookieHandlerTest
38 server = new MockWebServer(); in setUp()
43 server.shutdown(); in tearDown()
57 server.play(); in test_get_put()
58 server.enqueue(new MockResponse().addHeader("Set-Cookie2: a=\"android\"; " in test_get_put()
62 + "Domain=\"" + server.getCookieDomain() + "\"; " in test_get_put()
65 + "Port=\"80,443," + server.getPort() + "\"; " in test_get_put()
69 URLConnection connection = server.getUrl("/path/foo").openConnection(); in test_get_put()
DAbstractCookiesTest.java72 private MockWebServer server; field in AbstractCookiesTest
77 server = new MockWebServer(); in setUp()
85 server.shutdown(); in tearDown()
95 server.play(); in testNetscapeResponse()
97 server.enqueue(new MockResponse().addHeader("Set-Cookie: a=android; " in testNetscapeResponse()
100 + "domain=" + server.getCookieDomain() + "; " in testNetscapeResponse()
102 get(server, "/path/foo"); in testNetscapeResponse()
112 assertEquals(server.getCookieDomain(), cookie.getDomain()); in testNetscapeResponse()
123 server.play(); in testRfc2109Response()
125 server.enqueue(new MockResponse().addHeader("Set-Cookie: a=android; " in testRfc2109Response()
[all …]
DSocketTest.java274 MockServer server = new MockServer(); in testReadAfterClose() local
275 server.enqueue(new byte[]{5, 3}, 0); in testReadAfterClose()
276 Socket socket = new Socket("localhost", server.port); in testReadAfterClose()
292 server.shutdown(); in testReadAfterClose()
296 MockServer server = new MockServer(); in testWriteAfterClose() local
297 server.enqueue(new byte[0], 3); in testWriteAfterClose()
298 Socket socket = new Socket("localhost", server.port); in testWriteAfterClose()
311 server.shutdown(); in testWriteAfterClose()
460 ServerSocket server = new ServerSocket(0); in testSocketWithProxySet() local
461 Socket client = new Socket(InetAddress.getLocalHost(), server.getLocalPort()); in testSocketWithProxySet()
[all …]
DOldURLClassLoaderTest.java225 Support_TestWebServer server = new Support_TestWebServer(); in test_findResourceLjava_lang_String() local
228 int port = server.initServer(tmp.getAbsolutePath(), "text/html"); in test_findResourceLjava_lang_String()
239 server.close(); in test_findResourceLjava_lang_String()
255 Support_TestWebServer server = new Support_TestWebServer(); in test_findResource_String() local
257 int port = server.initServer(); in test_findResource_String()
276 server.close(); in test_findResource_String()
/libcore/support/src/test/java/libcore/javax/net/ssl/
DTestSSLSocketPair.java33 public final SSLSocket server; field in TestSSLSocketPair
37 SSLSocket server, in TestSSLSocketPair() argument
40 this.server = server; in TestSSLSocketPair()
47 server.close(); in close()
76 final SSLSocket server = (SSLSocket) context.serverSocket.accept(); in connect() local
82 server.setEnabledCipherSuites(serverCipherSuites); in connect()
84 server.startHandshake(); in connect()
123 return new SSLSocket[] { server, client }; in connect()
DTestSSLEnginePair.java35 public final SSLEngine server; field in TestSSLEnginePair
39 SSLEngine server, in TestSSLEnginePair() argument
42 this.server = server; in TestSSLEnginePair()
96 SSLEngine server = c.serverContext.createSSLEngine(); in connect() local
98 server.setUseClientMode(false); in connect()
99 hooks.beforeBeginHandshake(client, server); in connect()
101 server.beginHandshake(); in connect()
105 boolean serverDone = server.getHandshakeStatus() == HandshakeStatus.NOT_HANDSHAKING; in connect()
119 progress |= handshakeCompleted(server, in connect()
135 return new SSLEngine[] { server, client }; in connect()
[all …]
DTestSSLSessions.java38 public final SSLSession server; field in TestSSLSessions
52 SSLSession server, in TestSSLSessions() argument
56 this.server = server; in TestSSLSessions()
71 return new TestSSLSessions(invalid, s.server.getSession(), s.client.getSession(), s); in create()
DTestSSLContext.java252 public static TestSSLContext create(TestKeyStore client, TestKeyStore server) { in create() argument
253 return createWithAdditionalKeyManagers(client, server, null, null); in create()
261 TestKeyStore client, TestKeyStore server, in createWithAdditionalKeyManagers() argument
265 KeyManager[] serverKeyManagers = concat(server.keyManagers, additionalServerKeyManagers); in createWithAdditionalKeyManagers()
269 createSSLContext(protocol, serverKeyManagers, server.trustManagers); in createWithAdditionalKeyManagers()
271 server.keyStore, server.storePassword, in createWithAdditionalKeyManagers()
275 server.trustManagers[0], in createWithAdditionalKeyManagers()
/libcore/benchmarks/src/benchmarks/regression/
DURLConnectionBenchmark.java38 private MockWebServer server; field in URLConnectionBenchmark
53 server = new MockWebServer(); in setUp()
60 server.setDispatcher(new SingleResponseDispatcher(response)); in setUp()
61 server.play(); in setUp()
63 url = server.getUrl("/"); in setUp()
68 server.shutdown(); in tearDown()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/
DUnixSelectorTest.java64 Server server = new Server(); in testSelectorAcceptAndRead() local
65 SelectionKey mkey0 = server.serverChannel.register(sel0, SelectionKey.OP_ACCEPT); in testSelectorAcceptAndRead()
66 server.serverChannel.register(sel1, SelectionKey.OP_ACCEPT); in testSelectorAcceptAndRead()
71 server.initialize(); in testSelectorAcceptAndRead()
74 server.accept(); in testSelectorAcceptAndRead()
80 boolean isConnected = socketChannel.connect(server.socket.getLocalSocketAddress()); in testSelectorAcceptAndRead()
86 server.close(); in testSelectorAcceptAndRead()
/libcore/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/
DHttpURLConnectionTest.java188 MockServer server = new MockServer("server"); in testUsingProxy() local
191 URL url = new URL("http://localhost:" + server.port()); in testUsingProxy()
200 server.start(); in testUsingProxy()
202 if (!server.started) bound.wait(5000); in testUsingProxy()
212 server.join(); in testUsingProxy()
228 MockServer server = new MockServer("server"); in testUsingProxySelector() local
231 URL url = new URL("http://localhost:" + server.port()); in testUsingProxySelector()
237 new TestProxySelector(server.port(), proxy.port())); in testUsingProxySelector()
245 server.start(); in testUsingProxySelector()
247 if (!server.started) bound.wait(5000); in testUsingProxySelector()
[all …]
/libcore/luni/src/test/java/libcore/java/nio/channels/
DSelectorTest.java154 SocketChannel server = null; in test28318596() local
170 server = ssc.accept(); in test28318596()
171 server.write(ByteBuffer.allocate(8192)); in test28318596()
179 server.shutdownInput(); in test28318596()
180 server.shutdownOutput(); in test28318596()
195 server.close(); in test28318596()
205 if (server != null) { in test28318596()
206 server.close(); in test28318596()
/libcore/ojluni/src/main/java/sun/net/
DNetworkClient.java132 public void openServer(String server, int port) in openServer() argument
136 serverSocket = doConnect (server, port); in openServer()
151 protected Socket doConnect (String server, int port) in doConnect() argument
175 s.connect(new InetSocketAddress(server, port), connectTimeout); in doConnect()
178 s.connect(new InetSocketAddress(server, port), defaultConnectTimeout); in doConnect()
180 s.connect(new InetSocketAddress(server, port)); in doConnect()
/libcore/ojluni/src/main/java/java/net/
DSocksSocketImpl.java44 private String server = null; field in SocksSocketImpl
59 SocksSocketImpl(String server, int port) { in SocksSocketImpl() argument
60 this.server = server; in SocksSocketImpl()
69 server = ad.getHostString(); in SocksSocketImpl()
157 final InetAddress addr = InetAddress.getByName(server); in authenticate()
163server, addr, serverPort, "SOCKS5", "SOCKS authentication", null); in authenticate()
349 if (server == null) { in connect()
441 privilegedConnect(server, serverPort, remainingMillis(deadlineMillis)); in connect()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/
DSSLSessionTest.java80 KeyStore store = server.getStore(); in test_getPeerPrincipal()
241 TestServer server; field in SSLSessionTest
248 server = new TestServer(true, TestServer.CLIENT_AUTH_WANTED, serverKeys); in setUp()
251 serverThread = new Thread(server); in setUp()
262 && server.exception == null in setUp()
270 if (server.exception != null) { in setUp()
271 server.exception.printStackTrace(); in setUp()
273 assertNull("server thread has a pending exception: " + server.exception, in setUp()
274 server.exception); in setUp()
298 if (server.getException() != null) { in tearDown()
[all …]
/libcore/luni/src/test/java/libcore/libcore/io/
DFdsanTest.java119 Socket server = serverSocket.accept(); in testSocket() local
121 assertFdOwnedBySocket(server.getFileDescriptor$()); in testSocket()
123 server.close(); in testSocket()
/libcore/ojluni/annotations/hiddenapi/java/net/
DSocksSocketImpl.java38 SocksSocketImpl(java.lang.String server, int port) { in SocksSocketImpl() argument
132 private java.lang.String server; field in SocksSocketImpl
/libcore/luni/src/test/java/libcore/java/security/cert/
DPKIXParametersTest.java60 TestKeyStore server = TestKeyStore.getServer(); in keyStoreConstructor() local
61 KeyStore.PrivateKeyEntry pke = server.getPrivateKey("RSA", "RSA"); in keyStoreConstructor()
65 assertEquals(2, new PKIXParameters(server.keyStore).getTrustAnchors().size()); in keyStoreConstructor()
DPKIXRevocationCheckerTest.java47 TestKeyStore server = TestKeyStore.getServer(); in setUp() local
50 entity = server.getPrivateKey("RSA", "RSA"); in setUp()
/libcore/luni/src/test/java/libcore/xml/
DExpatSaxParserTest.java588 final MockWebServer server = new MockWebServer(); in testExternalEntityDownload() local
589 server.enqueue(new MockResponse().setBody("<bar></bar>")); in testExternalEntityDownload()
590 server.play(); in testExternalEntityDownload()
598 assertEquals(server.getUrl("/systemBar").toString(), systemId); in testExternalEntityDownload()
623 source.setSystemId(server.getUrl("/systemFoo").toString()); in testExternalEntityDownload()
626 server.shutdown(); in testExternalEntityDownload()
/libcore/luni/src/test/java/libcore/java/io/
DInterruptedStreamTest.java115 SocketChannel server = serverSocketChannel.accept(); in newSocketChannelPair() local
117 return new Socket[] { clientSocketChannel.socket(), server.socket() }; in newSocketChannelPair()
/libcore/luni/src/test/java/libcore/javax/net/ssl/
DSSLSocketTest.java75 + " server=" + test.server.getLocalPort()); in stress_test_TestSSLSocketPair_create()

12