assertEquals(receiverBufferSize, options.getReceiveBufferSize()); assertEquals(reuseAddress, options.isReuseAddress()); assertEquals(trafficClass, options.getTrafficClass());
private void checkCopyHttpServerOptions(HttpServerOptions options, HttpServerOptions copy) { assertEquals(options.getSendBufferSize(), copy.getSendBufferSize()); assertEquals(options.getReceiveBufferSize(), copy.getReceiveBufferSize()); assertEquals(options.isReuseAddress(), copy.isReuseAddress()); assertEquals(options.getTrafficClass(), copy.getTrafficClass());
assertIllegalArgumentException(() -> options.setSendBufferSize(-123)); assertEquals(NetworkOptions.DEFAULT_RECEIVE_BUFFER_SIZE, options.getReceiveBufferSize()); rand = TestUtils.randomPositiveInt(); assertEquals(options, options.setReceiveBufferSize(rand)); assertEquals(rand, options.getReceiveBufferSize()); assertIllegalArgumentException(() -> options.setReceiveBufferSize(0)); assertIllegalArgumentException(() -> options.setReceiveBufferSize(-123));
assertEquals(receiverBufferSize, options.getReceiveBufferSize()); assertEquals(reuseAddress, options.isReuseAddress()); assertEquals(trafficClass, options.getTrafficClass());
private void checkCopyHttpServerOptions(HttpServerOptions options, HttpServerOptions copy) { assertEquals(options.getSendBufferSize(), copy.getSendBufferSize()); assertEquals(options.getReceiveBufferSize(), copy.getReceiveBufferSize()); assertEquals(options.isReuseAddress(), copy.isReuseAddress()); assertEquals(options.getTrafficClass(), copy.getTrafficClass());
@Test public void testInit_With_Config() throws Exception { String host = "test.englishtown.com"; int port = 8888; int bufferSize = 1024; boolean ssl = true; boolean compressionSupported = true; when(serverOptions.getHost()).thenReturn(host); when(serverOptions.getPort()).thenReturn(port); when(serverOptions.getReceiveBufferSize()).thenReturn(bufferSize); when(serverOptions.isSsl()).thenReturn(ssl); when(serverOptions.isCompressionSupported()).thenReturn(compressionSupported); jerseyServer.start(); verifyExecuteBlocking(); verifyResults(port, host); verify(vertx).createHttpServer(optionsCaptor.capture()); HttpServerOptions options = optionsCaptor.getValue(); assertEquals(host, options.getHost()); assertEquals(port, options.getPort()); assertEquals(bufferSize, options.getReceiveBufferSize()); assertEquals(ssl, options.isSsl()); assertEquals(compressionSupported, options.isCompressionSupported()); }
assertIllegalArgumentException(() -> options.setSendBufferSize(-123)); assertEquals(NetworkOptions.DEFAULT_RECEIVE_BUFFER_SIZE, options.getReceiveBufferSize()); rand = TestUtils.randomPositiveInt(); assertEquals(options, options.setReceiveBufferSize(rand)); assertEquals(rand, options.getReceiveBufferSize()); assertIllegalArgumentException(() -> options.setReceiveBufferSize(0)); assertIllegalArgumentException(() -> options.setReceiveBufferSize(-123));