@Test public void testConnectInvalidHost() { assertNullPointerException(() -> client.connect(80, null, res -> {})); client.connect(1234, "127.0.0.2", res -> { assertTrue(res.failed()); assertFalse(res.succeeded()); assertNotNull(res.cause()); testComplete(); }); await(); }
@Test public void testConnectInvalidPort() { assertIllegalArgumentException(() -> client.connect(-1, "localhost", res -> {})); assertIllegalArgumentException(() -> client.connect(65536, "localhost", res -> {})); client.connect(9998, "localhost", res -> { assertTrue(res.failed()); assertFalse(res.succeeded()); assertNotNull(res.cause()); testComplete(); }); await(); }
@Test public void testListenInvalidPort() { /* Port 80 is free to use by any application on Windows, so this test fails. */ Assume.assumeFalse(System.getProperty("os.name").startsWith("Windows")); server.close(); server = vertx.createNetServer(new NetServerOptions().setPort(80)); server.connectHandler((netSocket) -> { }).listen(ar -> { assertTrue(ar.failed()); assertFalse(ar.succeeded()); assertNotNull(ar.cause()); testComplete(); }); await(); }
@Test public void testListenInvalidHost() { server.close(); server = vertx.createNetServer(new NetServerOptions().setPort(1234).setHost("uhqwduhqwudhqwuidhqwiudhqwudqwiuhd")); server.connectHandler(netSocket -> { }).listen(ar -> { assertTrue(ar.failed()); assertFalse(ar.succeeded()); assertNotNull(ar.cause()); testComplete(); }); await(); }
@Test public void testConnectInvalidHost() { assertNullPointerException(() -> client.connect(80, null, res -> {})); client.connect(1234, "127.0.0.2", res -> { assertTrue(res.failed()); assertFalse(res.succeeded()); assertNotNull(res.cause()); testComplete(); }); await(); }
@Test public void testListenInvalidPort() { /* Port 80 is free to use by any application on Windows, so this test fails. */ Assume.assumeFalse(System.getProperty("os.name").startsWith("Windows")); server.close(); server = vertx.createNetServer(new NetServerOptions().setPort(80)); server.connectHandler((netSocket) -> { }).listen(ar -> { assertTrue(ar.failed()); assertFalse(ar.succeeded()); assertNotNull(ar.cause()); testComplete(); }); await(); }
@Test public void testConnectInvalidPort() { assertIllegalArgumentException(() -> client.connect(-1, "localhost", res -> {})); assertIllegalArgumentException(() -> client.connect(65536, "localhost", res -> {})); client.connect(9998, "localhost", res -> { assertTrue(res.failed()); assertFalse(res.succeeded()); assertNotNull(res.cause()); testComplete(); }); await(); }
@Test public void testListenInvalidHost() { server.close(); server = vertx.createNetServer(new NetServerOptions().setPort(1234).setHost("uhqwduhqwudhqwuidhqwiudhqwudqwiuhd")); server.connectHandler(netSocket -> { }).listen(ar -> { assertTrue(ar.failed()); assertFalse(ar.succeeded()); assertNotNull(ar.cause()); testComplete(); }); await(); }
assertEquals(options, options.addEnabledCipherSuite("foo")); assertEquals(options, options.addEnabledCipherSuite("bar")); assertNotNull(options.getEnabledCipherSuites()); assertTrue(options.getEnabledCipherSuites().contains("foo")); assertTrue(options.getEnabledCipherSuites().contains("bar"));
assertEquals(options, options.addEnabledCipherSuite("foo")); assertEquals(options, options.addEnabledCipherSuite("bar")); assertNotNull(options.getEnabledCipherSuites()); assertTrue(options.getEnabledCipherSuites().contains("foo")); assertTrue(options.getEnabledCipherSuites().contains("bar"));
assertEquals(options, options.addEnabledCipherSuite("foo")); assertEquals(options, options.addEnabledCipherSuite("bar")); assertNotNull(options.getEnabledCipherSuites()); assertTrue(options.getEnabledCipherSuites().contains("foo")); assertTrue(options.getEnabledCipherSuites().contains("bar"));
assertEquals(options, options.addEnabledCipherSuite("foo")); assertEquals(options, options.addEnabledCipherSuite("bar")); assertNotNull(options.getEnabledCipherSuites()); assertTrue(options.getEnabledCipherSuites().contains("foo")); assertTrue(options.getEnabledCipherSuites().contains("bar"));