@Test public void testExceptionCaught() throws Exception { vertx.createNetClient(new NetClientOptions().setSoLinger(0)).connect(8080, "localhost", onSuccess(socket -> { vertx.setTimer(2000, id -> { socket.close(); }); })); awaitLatch(resetLatch); assertThat(caught.get(), instanceOf(IOException.class)); }
options.setTcpNoDelay(tcpNoDelay); options.setTcpKeepAlive(tcpKeepAlive); options.setSoLinger(soLinger); options.setUsePooledBuffers(usePooledBuffers); options.setIdleTimeout(idleTimeout);
assertEquals(soLinger, options.getSoLinger()); rand = TestUtils.randomPositiveInt(); assertEquals(options, options.setSoLinger(rand)); assertEquals(rand, options.getSoLinger()); assertIllegalArgumentException(() -> options.setSoLinger(-2));
@Override public ProtonClientOptions setSoLinger(int soLinger) { super.setSoLinger(soLinger); return this; }
@Override public PgConnectOptions setSoLinger(int soLinger) { return (PgConnectOptions)super.setSoLinger(soLinger); }
@Override public PgConnectOptions setSoLinger(int soLinger) { return (PgConnectOptions)super.setSoLinger(soLinger); }
@Test public void testExceptionCaught() throws Exception { vertx.createNetClient(new NetClientOptions().setSoLinger(0)).connect(8080, "localhost", onSuccess(socket -> { vertx.setTimer(2000, id -> { socket.close(); }); })); awaitLatch(resetLatch); assertThat(caught.get(), instanceOf(IOException.class)); }
options.setTcpNoDelay(tcpNoDelay); options.setTcpKeepAlive(tcpKeepAlive); options.setSoLinger(soLinger); options.setUsePooledBuffers(usePooledBuffers); options.setIdleTimeout(idleTimeout);
assertEquals(soLinger, options.getSoLinger()); rand = TestUtils.randomPositiveInt(); assertEquals(options, options.setSoLinger(rand)); assertEquals(rand, options.getSoLinger()); assertIllegalArgumentException(() -> options.setSoLinger(-2));