target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void bytesWritten() { metrics_listen1_server1.bytesWritten(socketMetric_listen1_1, anyRemoteAddr, 1); metrics_listen1_server2.bytesWritten(socketMetric_listen1_2, anyRemoteAddr, 2); metrics_listen2_server1.bytesWritten(socketMetric_listen2_1, anyRemoteAddr, 3); metrics_listen2_server2.bytesWritten(socketMe... | @Override public void bytesWritten(DefaultTcpSocketMetric socketMetric, SocketAddress remoteAddress, long numberOfBytes) { endpointMetric.addBytesWritten(numberOfBytes); } | DefaultTcpServerMetrics implements TCPMetrics<DefaultTcpSocketMetric> { @Override public void bytesWritten(DefaultTcpSocketMetric socketMetric, SocketAddress remoteAddress, long numberOfBytes) { endpointMetric.addBytesWritten(numberOfBytes); } } | DefaultTcpServerMetrics implements TCPMetrics<DefaultTcpSocketMetric> { @Override public void bytesWritten(DefaultTcpSocketMetric socketMetric, SocketAddress remoteAddress, long numberOfBytes) { endpointMetric.addBytesWritten(numberOfBytes); } DefaultTcpServerMetrics(DefaultServerEndpointMetric endpointMetric); } | DefaultTcpServerMetrics implements TCPMetrics<DefaultTcpSocketMetric> { @Override public void bytesWritten(DefaultTcpSocketMetric socketMetric, SocketAddress remoteAddress, long numberOfBytes) { endpointMetric.addBytesWritten(numberOfBytes); } DefaultTcpServerMetrics(DefaultServerEndpointMetric endpointMetric); Default... | DefaultTcpServerMetrics implements TCPMetrics<DefaultTcpSocketMetric> { @Override public void bytesWritten(DefaultTcpSocketMetric socketMetric, SocketAddress remoteAddress, long numberOfBytes) { endpointMetric.addBytesWritten(numberOfBytes); } DefaultTcpServerMetrics(DefaultServerEndpointMetric endpointMetric); Default... |
@Test public void createEndpoint() { Assert.assertSame(endpointMetric_a_1, endpointMetric_b_1); Assert.assertNotSame(endpointMetric_a_1, endpointMetric_a_2); Assert.assertNotSame(endpointMetric_a_2, endpointMetric_b_1); Assert.assertSame(endpointMetric_a_2, endpointMetric_b_2); Assert.assertEquals(2, endpointMetric_a_1... | @Override public DefaultClientEndpointMetric createEndpoint(String host, int port, int maxPoolSize) { return this.clientEndpointMetricManager.getOrCreateEndpointMetric(host + ":" + port); } | DefaultHttpClientMetrics implements
HttpClientMetrics<DefaultHttpSocketMetric, Object, DefaultHttpSocketMetric, DefaultClientEndpointMetric, Object> { @Override public DefaultClientEndpointMetric createEndpoint(String host, int port, int maxPoolSize) { return this.clientEndpointMetricManager.getOrCreateEndpointMetr... | DefaultHttpClientMetrics implements
HttpClientMetrics<DefaultHttpSocketMetric, Object, DefaultHttpSocketMetric, DefaultClientEndpointMetric, Object> { @Override public DefaultClientEndpointMetric createEndpoint(String host, int port, int maxPoolSize) { return this.clientEndpointMetricManager.getOrCreateEndpointMetr... | DefaultHttpClientMetrics implements
HttpClientMetrics<DefaultHttpSocketMetric, Object, DefaultHttpSocketMetric, DefaultClientEndpointMetric, Object> { @Override public DefaultClientEndpointMetric createEndpoint(String host, int port, int maxPoolSize) { return this.clientEndpointMetricManager.getOrCreateEndpointMetr... | DefaultHttpClientMetrics implements
HttpClientMetrics<DefaultHttpSocketMetric, Object, DefaultHttpSocketMetric, DefaultClientEndpointMetric, Object> { @Override public DefaultClientEndpointMetric createEndpoint(String host, int port, int maxPoolSize) { return this.clientEndpointMetricManager.getOrCreateEndpointMetr... |
@Test public void expire() { metricsOptionsEx.setCheckClientEndpointMetricExpiredInNano(10); nanoTime = 2; clientMetrics_a.disconnected(socketMetric_a_1, null); clientMetrics_a.disconnected(socketMetric_a_2, null); nanoTime = 13; defaultVertxMetrics.getClientEndpointMetricManager().onCheckClientEndpointMetricExpired(0)... | @Override public void disconnected(Object webSocketMetric) { } | DefaultHttpClientMetrics implements
HttpClientMetrics<DefaultHttpSocketMetric, Object, DefaultHttpSocketMetric, DefaultClientEndpointMetric, Object> { @Override public void disconnected(Object webSocketMetric) { } } | DefaultHttpClientMetrics implements
HttpClientMetrics<DefaultHttpSocketMetric, Object, DefaultHttpSocketMetric, DefaultClientEndpointMetric, Object> { @Override public void disconnected(Object webSocketMetric) { } DefaultHttpClientMetrics(DefaultClientEndpointMetricManager clientEndpointMetricManager); } | DefaultHttpClientMetrics implements
HttpClientMetrics<DefaultHttpSocketMetric, Object, DefaultHttpSocketMetric, DefaultClientEndpointMetric, Object> { @Override public void disconnected(Object webSocketMetric) { } DefaultHttpClientMetrics(DefaultClientEndpointMetricManager clientEndpointMetricManager); @Override De... | DefaultHttpClientMetrics implements
HttpClientMetrics<DefaultHttpSocketMetric, Object, DefaultHttpSocketMetric, DefaultClientEndpointMetric, Object> { @Override public void disconnected(Object webSocketMetric) { } DefaultHttpClientMetrics(DefaultClientEndpointMetricManager clientEndpointMetricManager); @Override De... |
@Test public void connect() { { Assert.assertSame(endpointMetric_a_1, socketMetric_a_1.getEndpointMetric()); Assert.assertTrue(socketMetric_a_1.isConnected()); Assert.assertEquals(1, socketMetric_a_1.getConnectedTime()); Assert.assertEquals(2, socketMetric_a_1.getEndpointMetric().getConnectCount()); Assert.assertEquals... | @Override public void disconnected(Object webSocketMetric) { } | DefaultHttpClientMetrics implements
HttpClientMetrics<DefaultHttpSocketMetric, Object, DefaultHttpSocketMetric, DefaultClientEndpointMetric, Object> { @Override public void disconnected(Object webSocketMetric) { } } | DefaultHttpClientMetrics implements
HttpClientMetrics<DefaultHttpSocketMetric, Object, DefaultHttpSocketMetric, DefaultClientEndpointMetric, Object> { @Override public void disconnected(Object webSocketMetric) { } DefaultHttpClientMetrics(DefaultClientEndpointMetricManager clientEndpointMetricManager); } | DefaultHttpClientMetrics implements
HttpClientMetrics<DefaultHttpSocketMetric, Object, DefaultHttpSocketMetric, DefaultClientEndpointMetric, Object> { @Override public void disconnected(Object webSocketMetric) { } DefaultHttpClientMetrics(DefaultClientEndpointMetricManager clientEndpointMetricManager); @Override De... | DefaultHttpClientMetrics implements
HttpClientMetrics<DefaultHttpSocketMetric, Object, DefaultHttpSocketMetric, DefaultClientEndpointMetric, Object> { @Override public void disconnected(Object webSocketMetric) { } DefaultHttpClientMetrics(DefaultClientEndpointMetricManager clientEndpointMetricManager); @Override De... |
@Test public void requestBegin(@Mocked HttpClientRequest request) { DefaultHttpSocketMetric socketMetric = clientMetrics_a.connected(address1, host); nanoTime = 2; clientMetrics_a.requestBegin(endpointMetric_a_1, socketMetric, address1, address1, request); nanoTime = 3; clientMetrics_a.requestEnd(socketMetric); Assert.... | @Override public DefaultHttpSocketMetric requestBegin(DefaultClientEndpointMetric endpointMetric, DefaultHttpSocketMetric socketMetric, SocketAddress localAddress, SocketAddress remoteAddress, HttpClientRequest request) { socketMetric.requestBegin(); return socketMetric; } | DefaultHttpClientMetrics implements
HttpClientMetrics<DefaultHttpSocketMetric, Object, DefaultHttpSocketMetric, DefaultClientEndpointMetric, Object> { @Override public DefaultHttpSocketMetric requestBegin(DefaultClientEndpointMetric endpointMetric, DefaultHttpSocketMetric socketMetric, SocketAddress localAddress, S... | DefaultHttpClientMetrics implements
HttpClientMetrics<DefaultHttpSocketMetric, Object, DefaultHttpSocketMetric, DefaultClientEndpointMetric, Object> { @Override public DefaultHttpSocketMetric requestBegin(DefaultClientEndpointMetric endpointMetric, DefaultHttpSocketMetric socketMetric, SocketAddress localAddress, S... | DefaultHttpClientMetrics implements
HttpClientMetrics<DefaultHttpSocketMetric, Object, DefaultHttpSocketMetric, DefaultClientEndpointMetric, Object> { @Override public DefaultHttpSocketMetric requestBegin(DefaultClientEndpointMetric endpointMetric, DefaultHttpSocketMetric socketMetric, SocketAddress localAddress, S... | DefaultHttpClientMetrics implements
HttpClientMetrics<DefaultHttpSocketMetric, Object, DefaultHttpSocketMetric, DefaultClientEndpointMetric, Object> { @Override public DefaultHttpSocketMetric requestBegin(DefaultClientEndpointMetric endpointMetric, DefaultHttpSocketMetric socketMetric, SocketAddress localAddress, S... |
@SuppressWarnings("deprecation") @Test public void metrics() { MetricsOptions metricsOptions = factory.newOptions(); options.setMetricsOptions(metricsOptions); VertxMetrics vertxMetrics = factory.metrics(options); Assert.assertSame(factory, metricsOptions.getFactory()); Assert.assertTrue(metricsOptions.isEnabled()); As... | @Override public synchronized VertxMetrics metrics(VertxOptions options) { if (vertxMetrics == null) { vertxMetrics = new DefaultVertxMetrics(options); } return vertxMetrics; } | DefaultVertxMetricsFactory implements VertxMetricsFactory { @Override public synchronized VertxMetrics metrics(VertxOptions options) { if (vertxMetrics == null) { vertxMetrics = new DefaultVertxMetrics(options); } return vertxMetrics; } } | DefaultVertxMetricsFactory implements VertxMetricsFactory { @Override public synchronized VertxMetrics metrics(VertxOptions options) { if (vertxMetrics == null) { vertxMetrics = new DefaultVertxMetrics(options); } return vertxMetrics; } } | DefaultVertxMetricsFactory implements VertxMetricsFactory { @Override public synchronized VertxMetrics metrics(VertxOptions options) { if (vertxMetrics == null) { vertxMetrics = new DefaultVertxMetrics(options); } return vertxMetrics; } DefaultVertxMetrics getVertxMetrics(); @Override synchronized VertxMetrics metrics... | DefaultVertxMetricsFactory implements VertxMetricsFactory { @Override public synchronized VertxMetrics metrics(VertxOptions options) { if (vertxMetrics == null) { vertxMetrics = new DefaultVertxMetrics(options); } return vertxMetrics; } DefaultVertxMetrics getVertxMetrics(); @Override synchronized VertxMetrics metrics... |
@Test public void expire() { metricsOptionsEx.setCheckClientEndpointMetricExpiredInNano(10); nanoTime = 2; clientMetrics_a.disconnected(socketMetric_a_1, null); clientMetrics_a.disconnected(socketMetric_a_2, null); nanoTime = 13; defaultVertxMetrics.getClientEndpointMetricManager().onCheckClientEndpointMetricExpired(0)... | @Override public void disconnected(DefaultTcpSocketMetric socketMetric, SocketAddress remoteAddress) { socketMetric.onDisconnect(); } | DefaultTcpClientMetrics implements TCPMetrics<DefaultTcpSocketMetric> { @Override public void disconnected(DefaultTcpSocketMetric socketMetric, SocketAddress remoteAddress) { socketMetric.onDisconnect(); } } | DefaultTcpClientMetrics implements TCPMetrics<DefaultTcpSocketMetric> { @Override public void disconnected(DefaultTcpSocketMetric socketMetric, SocketAddress remoteAddress) { socketMetric.onDisconnect(); } DefaultTcpClientMetrics(DefaultClientEndpointMetricManager clientEndpointMetricManager); } | DefaultTcpClientMetrics implements TCPMetrics<DefaultTcpSocketMetric> { @Override public void disconnected(DefaultTcpSocketMetric socketMetric, SocketAddress remoteAddress) { socketMetric.onDisconnect(); } DefaultTcpClientMetrics(DefaultClientEndpointMetricManager clientEndpointMetricManager); @Override DefaultTcpSocke... | DefaultTcpClientMetrics implements TCPMetrics<DefaultTcpSocketMetric> { @Override public void disconnected(DefaultTcpSocketMetric socketMetric, SocketAddress remoteAddress) { socketMetric.onDisconnect(); } DefaultTcpClientMetrics(DefaultClientEndpointMetricManager clientEndpointMetricManager); @Override DefaultTcpSocke... |
@Test public void connect() { { Assert.assertSame(endpointMetric_a_1, socketMetric_a_1.getEndpointMetric()); Assert.assertTrue(socketMetric_a_1.isConnected()); Assert.assertEquals(1, socketMetric_a_1.getConnectedTime()); Assert.assertEquals(2, socketMetric_a_1.getEndpointMetric().getConnectCount()); Assert.assertEquals... | @Override public void disconnected(DefaultTcpSocketMetric socketMetric, SocketAddress remoteAddress) { socketMetric.onDisconnect(); } | DefaultTcpClientMetrics implements TCPMetrics<DefaultTcpSocketMetric> { @Override public void disconnected(DefaultTcpSocketMetric socketMetric, SocketAddress remoteAddress) { socketMetric.onDisconnect(); } } | DefaultTcpClientMetrics implements TCPMetrics<DefaultTcpSocketMetric> { @Override public void disconnected(DefaultTcpSocketMetric socketMetric, SocketAddress remoteAddress) { socketMetric.onDisconnect(); } DefaultTcpClientMetrics(DefaultClientEndpointMetricManager clientEndpointMetricManager); } | DefaultTcpClientMetrics implements TCPMetrics<DefaultTcpSocketMetric> { @Override public void disconnected(DefaultTcpSocketMetric socketMetric, SocketAddress remoteAddress) { socketMetric.onDisconnect(); } DefaultTcpClientMetrics(DefaultClientEndpointMetricManager clientEndpointMetricManager); @Override DefaultTcpSocke... | DefaultTcpClientMetrics implements TCPMetrics<DefaultTcpSocketMetric> { @Override public void disconnected(DefaultTcpSocketMetric socketMetric, SocketAddress remoteAddress) { socketMetric.onDisconnect(); } DefaultTcpClientMetrics(DefaultClientEndpointMetricManager clientEndpointMetricManager); @Override DefaultTcpSocke... |
@Test public void getTransportVertx() { Assert.assertNotNull(SharedVertxFactory.getSharedVertx()); Assert.assertSame(SharedVertxFactory.getSharedVertx(), SharedVertxFactory.getSharedVertx()); SharedVertxFactory.getSharedVertx().close(); } | public static Vertx getSharedVertx() { return VertxUtils.getVertxMap().computeIfAbsent("transport", SharedVertxFactory::createSharedVertx); } | SharedVertxFactory { public static Vertx getSharedVertx() { return VertxUtils.getVertxMap().computeIfAbsent("transport", SharedVertxFactory::createSharedVertx); } } | SharedVertxFactory { public static Vertx getSharedVertx() { return VertxUtils.getVertxMap().computeIfAbsent("transport", SharedVertxFactory::createSharedVertx); } } | SharedVertxFactory { public static Vertx getSharedVertx() { return VertxUtils.getVertxMap().computeIfAbsent("transport", SharedVertxFactory::createSharedVertx); } static DefaultVertxMetricsFactory getMetricsFactory(); static Vertx getSharedVertx(); } | SharedVertxFactory { public static Vertx getSharedVertx() { return VertxUtils.getVertxMap().computeIfAbsent("transport", SharedVertxFactory::createSharedVertx); } static DefaultVertxMetricsFactory getMetricsFactory(); static Vertx getSharedVertx(); } |
@Test public void testServiceCombVersion() { ServiceCombVersion version = new ServiceCombVersion(); Assert.assertTrue(version.loadVersion().toString().contains("ServiceComb")); } | @Override public Map<String, String> loadVersion() { Map<String, String> map = new HashMap<>(); map.put("ServiceComb", this.getClass().getPackage().getImplementationVersion()); return map; } | ServiceCombVersion implements Versions { @Override public Map<String, String> loadVersion() { Map<String, String> map = new HashMap<>(); map.put("ServiceComb", this.getClass().getPackage().getImplementationVersion()); return map; } } | ServiceCombVersion implements Versions { @Override public Map<String, String> loadVersion() { Map<String, String> map = new HashMap<>(); map.put("ServiceComb", this.getClass().getPackage().getImplementationVersion()); return map; } } | ServiceCombVersion implements Versions { @Override public Map<String, String> loadVersion() { Map<String, String> map = new HashMap<>(); map.put("ServiceComb", this.getClass().getPackage().getImplementationVersion()); return map; } @Override Map<String, String> loadVersion(); } | ServiceCombVersion implements Versions { @Override public Map<String, String> loadVersion() { Map<String, String> map = new HashMap<>(); map.put("ServiceComb", this.getClass().getPackage().getImplementationVersion()); return map; } @Override Map<String, String> loadVersion(); } |
@Test public void testgetBytesFastBufferInputStream() throws IOException { byte[] bytes = new byte[] {1}; ByteBuf byteBuf = Unpooled.wrappedBuffer(bytes); try (BufferInputStream inputStream = new BufferInputStream(byteBuf)) { byte[] result = VertxUtils.getBytesFast(inputStream); Assert.assertSame(bytes, result); } } | public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } } | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } private VertxUtils(); } | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } private VertxUtils(); static Map<String, Vertx> getVertxM... | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } private VertxUtils(); static Map<String, Vertx> getVertxM... |
@Test public void testgetBytesFastNormalInputStream() throws IOException { byte[] bytes = new byte[] {1}; try (InputStream inputStream = new ByteArrayInputStream(bytes)) { byte[] result = VertxUtils.getBytesFast(inputStream); Assert.assertEquals(1, result[0]); } } | public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } } | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } private VertxUtils(); } | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } private VertxUtils(); static Map<String, Vertx> getVertxM... | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } private VertxUtils(); static Map<String, Vertx> getVertxM... |
@Test public void testgetBytesFastBuffer() { Buffer buffer = Buffer.buffer(); buffer.appendByte((byte) 1); byte[] result = VertxUtils.getBytesFast(buffer); Assert.assertEquals(1, result[0]); } | public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } } | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } private VertxUtils(); } | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } private VertxUtils(); static Map<String, Vertx> getVertxM... | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } private VertxUtils(); static Map<String, Vertx> getVertxM... |
@Test public void testgetBytesFastByteBufHasArray() { byte[] bytes = new byte[] {1}; ByteBuf byteBuf = Unpooled.wrappedBuffer(bytes); byte[] result = VertxUtils.getBytesFast(byteBuf); Assert.assertSame(bytes, result); } | public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } } | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } private VertxUtils(); } | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } private VertxUtils(); static Map<String, Vertx> getVertxM... | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } private VertxUtils(); static Map<String, Vertx> getVertxM... |
@Test public void testgetBytesFastByteBufCopy() { ByteBuf byteBuf = Unpooled.directBuffer(); byteBuf.writeByte(1); Assert.assertFalse(byteBuf.hasArray()); byte[] result = VertxUtils.getBytesFast(byteBuf); Assert.assertEquals(1, result[0]); byteBuf.release(); } | public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } } | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } private VertxUtils(); } | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } private VertxUtils(); static Map<String, Vertx> getVertxM... | VertxUtils { public static byte[] getBytesFast(InputStream inputStream) throws IOException { if (BufferInputStream.class.isInstance(inputStream)) { return getBytesFast(((BufferInputStream) inputStream).getByteBuf()); } return IOUtils.toByteArray(inputStream); } private VertxUtils(); static Map<String, Vertx> getVertxM... |
@Test public void testRead() { Assert.assertEquals(0, instance.read()); } | @Override public int read() { return byteBuf.readUnsignedByte(); } | BufferInputStream extends ServletInputStream { @Override public int read() { return byteBuf.readUnsignedByte(); } } | BufferInputStream extends ServletInputStream { @Override public int read() { return byteBuf.readUnsignedByte(); } BufferInputStream(ByteBuf buffer); } | BufferInputStream extends ServletInputStream { @Override public int read() { return byteBuf.readUnsignedByte(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String read... | BufferInputStream extends ServletInputStream { @Override public int read() { return byteBuf.readUnsignedByte(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String read... |
@Test public void testReadByteArray() throws UnsupportedEncodingException { byte[] b = "csr".getBytes("UTF-8"); Assert.assertEquals(-1, instance.read(b)); } | @Override public int read() { return byteBuf.readUnsignedByte(); } | BufferInputStream extends ServletInputStream { @Override public int read() { return byteBuf.readUnsignedByte(); } } | BufferInputStream extends ServletInputStream { @Override public int read() { return byteBuf.readUnsignedByte(); } BufferInputStream(ByteBuf buffer); } | BufferInputStream extends ServletInputStream { @Override public int read() { return byteBuf.readUnsignedByte(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String read... | BufferInputStream extends ServletInputStream { @Override public int read() { return byteBuf.readUnsignedByte(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String read... |
@Test public void testReadByteArrayIntInt() throws UnsupportedEncodingException { byte[] b = "csr".getBytes("UTF-8"); Assert.assertEquals(-1, instance.read(b, 1, 0)); } | @Override public int read() { return byteBuf.readUnsignedByte(); } | BufferInputStream extends ServletInputStream { @Override public int read() { return byteBuf.readUnsignedByte(); } } | BufferInputStream extends ServletInputStream { @Override public int read() { return byteBuf.readUnsignedByte(); } BufferInputStream(ByteBuf buffer); } | BufferInputStream extends ServletInputStream { @Override public int read() { return byteBuf.readUnsignedByte(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String read... | BufferInputStream extends ServletInputStream { @Override public int read() { return byteBuf.readUnsignedByte(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String read... |
@Test public void testSkip() { Assert.assertEquals(0, instance.skip(1)); } | @Override public long skip(long len) { int skipLen = Math.min((int) len, available()); byteBuf.skipBytes(skipLen); return skipLen; } | BufferInputStream extends ServletInputStream { @Override public long skip(long len) { int skipLen = Math.min((int) len, available()); byteBuf.skipBytes(skipLen); return skipLen; } } | BufferInputStream extends ServletInputStream { @Override public long skip(long len) { int skipLen = Math.min((int) len, available()); byteBuf.skipBytes(skipLen); return skipLen; } BufferInputStream(ByteBuf buffer); } | BufferInputStream extends ServletInputStream { @Override public long skip(long len) { int skipLen = Math.min((int) len, available()); byteBuf.skipBytes(skipLen); return skipLen; } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readSh... | BufferInputStream extends ServletInputStream { @Override public long skip(long len) { int skipLen = Math.min((int) len, available()); byteBuf.skipBytes(skipLen); return skipLen; } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readSh... |
@Test public void testAvailable() { Assert.assertEquals(0, instance.available()); } | @Override public int available() { return byteBuf.readableBytes(); } | BufferInputStream extends ServletInputStream { @Override public int available() { return byteBuf.readableBytes(); } } | BufferInputStream extends ServletInputStream { @Override public int available() { return byteBuf.readableBytes(); } BufferInputStream(ByteBuf buffer); } | BufferInputStream extends ServletInputStream { @Override public int available() { return byteBuf.readableBytes(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String re... | BufferInputStream extends ServletInputStream { @Override public int available() { return byteBuf.readableBytes(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String re... |
@Test public void testDefaultValues() { Assert.assertNull(oRegisterInstanceRequest.getInstance()); } | public MicroserviceInstance getInstance() { return instance; } | RegisterInstanceRequest { public MicroserviceInstance getInstance() { return instance; } } | RegisterInstanceRequest { public MicroserviceInstance getInstance() { return instance; } } | RegisterInstanceRequest { public MicroserviceInstance getInstance() { return instance; } MicroserviceInstance getInstance(); void setInstance(MicroserviceInstance instance); } | RegisterInstanceRequest { public MicroserviceInstance getInstance() { return instance; } MicroserviceInstance getInstance(); void setInstance(MicroserviceInstance instance); } |
@Test public void testClose() { try { instance.close(); } catch (Exception e) { Assert.assertTrue(false); } } | @Override public void close() { byteBuf.release(); } | BufferInputStream extends ServletInputStream { @Override public void close() { byteBuf.release(); } } | BufferInputStream extends ServletInputStream { @Override public void close() { byteBuf.release(); } BufferInputStream(ByteBuf buffer); } | BufferInputStream extends ServletInputStream { @Override public void close() { byteBuf.release(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String readString(); @Ove... | BufferInputStream extends ServletInputStream { @Override public void close() { byteBuf.release(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String readString(); @Ove... |
@Test public void testBufferInputStream() { Assert.assertNotNull(instance); } | public BufferInputStream(ByteBuf buffer) { this.byteBuf = buffer; } | BufferInputStream extends ServletInputStream { public BufferInputStream(ByteBuf buffer) { this.byteBuf = buffer; } } | BufferInputStream extends ServletInputStream { public BufferInputStream(ByteBuf buffer) { this.byteBuf = buffer; } BufferInputStream(ByteBuf buffer); } | BufferInputStream extends ServletInputStream { public BufferInputStream(ByteBuf buffer) { this.byteBuf = buffer; } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String rea... | BufferInputStream extends ServletInputStream { public BufferInputStream(ByteBuf buffer) { this.byteBuf = buffer; } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String rea... |
@Test public void testReadBoolean() { Assert.assertEquals(false, instance.readBoolean()); } | public boolean readBoolean() { return byteBuf.readBoolean(); } | BufferInputStream extends ServletInputStream { public boolean readBoolean() { return byteBuf.readBoolean(); } } | BufferInputStream extends ServletInputStream { public boolean readBoolean() { return byteBuf.readBoolean(); } BufferInputStream(ByteBuf buffer); } | BufferInputStream extends ServletInputStream { public boolean readBoolean() { return byteBuf.readBoolean(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String readStri... | BufferInputStream extends ServletInputStream { public boolean readBoolean() { return byteBuf.readBoolean(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String readStri... |
@Test public void testReadShort() { Assert.assertEquals(0, instance.readShort()); } | public short readShort() { return byteBuf.readShort(); } | BufferInputStream extends ServletInputStream { public short readShort() { return byteBuf.readShort(); } } | BufferInputStream extends ServletInputStream { public short readShort() { return byteBuf.readShort(); } BufferInputStream(ByteBuf buffer); } | BufferInputStream extends ServletInputStream { public short readShort() { return byteBuf.readShort(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String readString(); ... | BufferInputStream extends ServletInputStream { public short readShort() { return byteBuf.readShort(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String readString(); ... |
@Test public void testReadInt() { Assert.assertEquals(0, instance.readInt()); } | public int readInt() { return byteBuf.readInt(); } | BufferInputStream extends ServletInputStream { public int readInt() { return byteBuf.readInt(); } } | BufferInputStream extends ServletInputStream { public int readInt() { return byteBuf.readInt(); } BufferInputStream(ByteBuf buffer); } | BufferInputStream extends ServletInputStream { public int readInt() { return byteBuf.readInt(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String readString(); @Overr... | BufferInputStream extends ServletInputStream { public int readInt() { return byteBuf.readInt(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String readString(); @Overr... |
@Test public void testReadLong() { Assert.assertEquals(0, instance.readLong()); } | public long readLong() { return byteBuf.readLong(); } | BufferInputStream extends ServletInputStream { public long readLong() { return byteBuf.readLong(); } } | BufferInputStream extends ServletInputStream { public long readLong() { return byteBuf.readLong(); } BufferInputStream(ByteBuf buffer); } | BufferInputStream extends ServletInputStream { public long readLong() { return byteBuf.readLong(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String readString(); @Ov... | BufferInputStream extends ServletInputStream { public long readLong() { return byteBuf.readLong(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String readString(); @Ov... |
@Test public void testGetIndex() { Assert.assertEquals(0, instance.getIndex()); } | public int getIndex() { return byteBuf.readerIndex(); } | BufferInputStream extends ServletInputStream { public int getIndex() { return byteBuf.readerIndex(); } } | BufferInputStream extends ServletInputStream { public int getIndex() { return byteBuf.readerIndex(); } BufferInputStream(ByteBuf buffer); } | BufferInputStream extends ServletInputStream { public int getIndex() { return byteBuf.readerIndex(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String readString(); @... | BufferInputStream extends ServletInputStream { public int getIndex() { return byteBuf.readerIndex(); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); boolean readBoolean(); short readShort(); int readInt(); long readLong(); int getIndex(); String readString(); @... |
@Test public void testReadString() { Assert.assertNotNull(instance.readString()); } | public String readString() { int length = readInt(); byte[] bytes = new byte[length]; byteBuf.readBytes(bytes); return new String(bytes, StandardCharsets.UTF_8); } | BufferInputStream extends ServletInputStream { public String readString() { int length = readInt(); byte[] bytes = new byte[length]; byteBuf.readBytes(bytes); return new String(bytes, StandardCharsets.UTF_8); } } | BufferInputStream extends ServletInputStream { public String readString() { int length = readInt(); byte[] bytes = new byte[length]; byteBuf.readBytes(bytes); return new String(bytes, StandardCharsets.UTF_8); } BufferInputStream(ByteBuf buffer); } | BufferInputStream extends ServletInputStream { public String readString() { int length = readInt(); byte[] bytes = new byte[length]; byteBuf.readBytes(bytes); return new String(bytes, StandardCharsets.UTF_8); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); bool... | BufferInputStream extends ServletInputStream { public String readString() { int length = readInt(); byte[] bytes = new byte[length]; byteBuf.readBytes(bytes); return new String(bytes, StandardCharsets.UTF_8); } BufferInputStream(ByteBuf buffer); @Override long skip(long len); byte readByte(); @Override int read(); bool... |
@Test public void testGetResoverFromResource(@Mocked Configuration finalConfig) { ArchaiusUtils.resetConfig(); ArchaiusUtils.setProperty("addressResolver.servers", "8.8.8.8,8.8.4.4"); new Expectations() { { finalConfig.getStringArray("addressResolver.servers"); result = new String[] {"6.6.6.6", "6.6.4.4"}; finalConfig.... | public static AddressResolverOptions getAddressResover(String tag) { return getAddressResover(tag, null); } | AddressResolverConfig { public static AddressResolverOptions getAddressResover(String tag) { return getAddressResover(tag, null); } } | AddressResolverConfig { public static AddressResolverOptions getAddressResover(String tag) { return getAddressResover(tag, null); } } | AddressResolverConfig { public static AddressResolverOptions getAddressResover(String tag) { return getAddressResover(tag, null); } static AddressResolverOptions getAddressResover(String tag); static AddressResolverOptions getAddressResover(String tag, Configuration configSource); } | AddressResolverConfig { public static AddressResolverOptions getAddressResover(String tag) { return getAddressResover(tag, null); } static AddressResolverOptions getAddressResover(String tag); static AddressResolverOptions getAddressResover(String tag, Configuration configSource); } |
@Test public void testGetResover() { ArchaiusUtils.resetConfig(); ArchaiusUtils.setProperty("addressResolver.servers", "8.8.8.8,8.8.4.4"); ArchaiusUtils.setProperty("addressResolver.optResourceEnabled", true); ArchaiusUtils.setProperty("addressResolver.cacheMinTimeToLive", 0); ArchaiusUtils.setProperty("addressResolver... | public static AddressResolverOptions getAddressResover(String tag) { return getAddressResover(tag, null); } | AddressResolverConfig { public static AddressResolverOptions getAddressResover(String tag) { return getAddressResover(tag, null); } } | AddressResolverConfig { public static AddressResolverOptions getAddressResover(String tag) { return getAddressResover(tag, null); } } | AddressResolverConfig { public static AddressResolverOptions getAddressResover(String tag) { return getAddressResover(tag, null); } static AddressResolverOptions getAddressResover(String tag); static AddressResolverOptions getAddressResover(String tag, Configuration configSource); } | AddressResolverConfig { public static AddressResolverOptions getAddressResover(String tag) { return getAddressResover(tag, null); } static AddressResolverOptions getAddressResover(String tag); static AddressResolverOptions getAddressResover(String tag, Configuration configSource); } |
@Test public void testInitializedValues() { initRegisterInstanceRequest(); Assert.assertEquals(oMockMicroserviceInstance, oRegisterInstanceRequest.getInstance()); } | public MicroserviceInstance getInstance() { return instance; } | RegisterInstanceRequest { public MicroserviceInstance getInstance() { return instance; } } | RegisterInstanceRequest { public MicroserviceInstance getInstance() { return instance; } } | RegisterInstanceRequest { public MicroserviceInstance getInstance() { return instance; } MicroserviceInstance getInstance(); void setInstance(MicroserviceInstance instance); } | RegisterInstanceRequest { public MicroserviceInstance getInstance() { return instance; } MicroserviceInstance getInstance(); void setInstance(MicroserviceInstance instance); } |
@Test public void testGetResoverDefault() { ArchaiusUtils.resetConfig(); ArchaiusUtils.setProperty("addressResolver.servers", "8.8.8.8,8.8.4.4"); ArchaiusUtils.setProperty("addressResolver.maxQueries", 3); ArchaiusUtils.setProperty("addressResolver.rdFlag", false); AddressResolverOptions aroc = AddressResolverConfig.ge... | public static AddressResolverOptions getAddressResover(String tag) { return getAddressResover(tag, null); } | AddressResolverConfig { public static AddressResolverOptions getAddressResover(String tag) { return getAddressResover(tag, null); } } | AddressResolverConfig { public static AddressResolverOptions getAddressResover(String tag) { return getAddressResover(tag, null); } } | AddressResolverConfig { public static AddressResolverOptions getAddressResover(String tag) { return getAddressResover(tag, null); } static AddressResolverOptions getAddressResover(String tag); static AddressResolverOptions getAddressResover(String tag, Configuration configSource); } | AddressResolverConfig { public static AddressResolverOptions getAddressResover(String tag) { return getAddressResover(tag, null); } static AddressResolverOptions getAddressResover(String tag); static AddressResolverOptions getAddressResover(String tag, Configuration configSource); } |
@Test public void createClientPool(@Mocked HttpClientWithContext pool) { new Expectations(VertxImpl.class) { { factory.createClientPool(context); result = pool; } }; Assert.assertSame(pool, poolMgr.createClientPool(context)); Assert.assertSame(pool, context.get(id)); Assert.assertThat(pools, Matchers.contains(pool)); } | public CLIENT_POOL createClientPool(Context context) { CLIENT_POOL pool = factory.createClientPool(context); addPool(context, pool); return pool; } | ClientPoolManager { public CLIENT_POOL createClientPool(Context context) { CLIENT_POOL pool = factory.createClientPool(context); addPool(context, pool); return pool; } } | ClientPoolManager { public CLIENT_POOL createClientPool(Context context) { CLIENT_POOL pool = factory.createClientPool(context); addPool(context, pool); return pool; } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); } | ClientPoolManager { public CLIENT_POOL createClientPool(Context context) { CLIENT_POOL pool = factory.createClientPool(context); addPool(context, pool); return pool; } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); CLIENT_POOL createClientPool(Context context); CLIENT_POOL findClientPool(boolea... | ClientPoolManager { public CLIENT_POOL createClientPool(Context context) { CLIENT_POOL pool = factory.createClientPool(context); addPool(context, pool); return pool; } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); CLIENT_POOL createClientPool(Context context); CLIENT_POOL findClientPool(boolea... |
@Test public void findThreadBindClientPool(@Mocked HttpClientWithContext pool1, @Mocked HttpClientWithContext pool2) { pools.add(pool1); pools.add(pool2); new MockUp<Thread>() { @Mock long getId() { return 0; } }; Assert.assertSame(pool1, poolMgr.findThreadBindClientPool()); Assert.assertSame(pool1, poolMgr.findThreadB... | public CLIENT_POOL findThreadBindClientPool() { assertPoolsInitialized(); int idx = (int) (Thread.currentThread().getId() % pools.size()); return pools.get(idx); } | ClientPoolManager { public CLIENT_POOL findThreadBindClientPool() { assertPoolsInitialized(); int idx = (int) (Thread.currentThread().getId() % pools.size()); return pools.get(idx); } } | ClientPoolManager { public CLIENT_POOL findThreadBindClientPool() { assertPoolsInitialized(); int idx = (int) (Thread.currentThread().getId() % pools.size()); return pools.get(idx); } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); } | ClientPoolManager { public CLIENT_POOL findThreadBindClientPool() { assertPoolsInitialized(); int idx = (int) (Thread.currentThread().getId() % pools.size()); return pools.get(idx); } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); CLIENT_POOL createClientPool(Context context); CLIENT_POOL findC... | ClientPoolManager { public CLIENT_POOL findThreadBindClientPool() { assertPoolsInitialized(); int idx = (int) (Thread.currentThread().getId() % pools.size()); return pools.get(idx); } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); CLIENT_POOL createClientPool(Context context); CLIENT_POOL findC... |
@Test public void findByContext_wrongContext_reverse() { HttpClientWithContext pool1 = new HttpClientWithContext(null, null); HttpClientWithContext pool2 = new HttpClientWithContext(null, null); pools.add(pool1); pools.add(pool2); new Expectations() { { Vertx.currentContext(); result = null; } }; AtomicInteger reactive... | protected CLIENT_POOL findByContext() { return findByContext(null); } | ClientPoolManager { protected CLIENT_POOL findByContext() { return findByContext(null); } } | ClientPoolManager { protected CLIENT_POOL findByContext() { return findByContext(null); } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); } | ClientPoolManager { protected CLIENT_POOL findByContext() { return findByContext(null); } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); CLIENT_POOL createClientPool(Context context); CLIENT_POOL findClientPool(boolean sync); CLIENT_POOL findClientPool(boolean sync, Context targetContext); CLIE... | ClientPoolManager { protected CLIENT_POOL findByContext() { return findByContext(null); } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); CLIENT_POOL createClientPool(Context context); CLIENT_POOL findClientPool(boolean sync); CLIENT_POOL findClientPool(boolean sync, Context targetContext); CLIE... |
@Test public void findByContext_normalThread() { HttpClientWithContext pool = new HttpClientWithContext(null, null); pools.add(pool); new Expectations() { { Vertx.currentContext(); result = null; } }; Assert.assertSame(pool, poolMgr.findByContext()); } | protected CLIENT_POOL findByContext() { return findByContext(null); } | ClientPoolManager { protected CLIENT_POOL findByContext() { return findByContext(null); } } | ClientPoolManager { protected CLIENT_POOL findByContext() { return findByContext(null); } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); } | ClientPoolManager { protected CLIENT_POOL findByContext() { return findByContext(null); } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); CLIENT_POOL createClientPool(Context context); CLIENT_POOL findClientPool(boolean sync); CLIENT_POOL findClientPool(boolean sync, Context targetContext); CLIE... | ClientPoolManager { protected CLIENT_POOL findByContext() { return findByContext(null); } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); CLIENT_POOL createClientPool(Context context); CLIENT_POOL findClientPool(boolean sync); CLIENT_POOL findClientPool(boolean sync, Context targetContext); CLIE... |
@Test public void findByContext_otherVertx(@Mocked VertxImpl otherVertx, @Mocked Context otherContext) { HttpClientWithContext pool = new HttpClientWithContext(null, null); pools.add(pool); new Expectations() { { Vertx.currentContext(); result = otherContext; otherContext.owner(); result = otherVertx; } }; Assert.asser... | protected CLIENT_POOL findByContext() { return findByContext(null); } | ClientPoolManager { protected CLIENT_POOL findByContext() { return findByContext(null); } } | ClientPoolManager { protected CLIENT_POOL findByContext() { return findByContext(null); } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); } | ClientPoolManager { protected CLIENT_POOL findByContext() { return findByContext(null); } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); CLIENT_POOL createClientPool(Context context); CLIENT_POOL findClientPool(boolean sync); CLIENT_POOL findClientPool(boolean sync, Context targetContext); CLIE... | ClientPoolManager { protected CLIENT_POOL findByContext() { return findByContext(null); } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); CLIENT_POOL createClientPool(Context context); CLIENT_POOL findClientPool(boolean sync); CLIENT_POOL findClientPool(boolean sync, Context targetContext); CLIE... |
@Test public void findByContext_worker(@Mocked Context workerContext) { HttpClientWithContext pool = new HttpClientWithContext(null, null); pools.add(pool); new Expectations() { { Vertx.currentContext(); result = workerContext; workerContext.owner(); result = vertx; workerContext.isEventLoopContext(); result = false; }... | protected CLIENT_POOL findByContext() { return findByContext(null); } | ClientPoolManager { protected CLIENT_POOL findByContext() { return findByContext(null); } } | ClientPoolManager { protected CLIENT_POOL findByContext() { return findByContext(null); } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); } | ClientPoolManager { protected CLIENT_POOL findByContext() { return findByContext(null); } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); CLIENT_POOL createClientPool(Context context); CLIENT_POOL findClientPool(boolean sync); CLIENT_POOL findClientPool(boolean sync, Context targetContext); CLIE... | ClientPoolManager { protected CLIENT_POOL findByContext() { return findByContext(null); } ClientPoolManager(Vertx vertx, ClientPoolFactory<CLIENT_POOL> factory); CLIENT_POOL createClientPool(Context context); CLIENT_POOL findClientPool(boolean sync); CLIENT_POOL findClientPool(boolean sync, Context targetContext); CLIE... |
@Test public void createClientPool(@Mocked VertxInternal vertx, @Mocked ContextInternal context, @Mocked HttpClient httpClient) { new Expectations(VertxImpl.class) { { context.owner(); result = vertx; vertx.createHttpClient(httpClientOptions); result = httpClient; } }; HttpClientWithContext pool = factory.createClientP... | @Override public HttpClientWithContext createClientPool(Context context) { HttpClient httpClient = context.owner().createHttpClient(httpClientOptions); httpClient.connectionHandler(connection -> { LOGGER.debug("http connection connected, local:{}, remote:{}.", connection.localAddress(), connection.remoteAddress()); con... | HttpClientPoolFactory implements ClientPoolFactory<HttpClientWithContext> { @Override public HttpClientWithContext createClientPool(Context context) { HttpClient httpClient = context.owner().createHttpClient(httpClientOptions); httpClient.connectionHandler(connection -> { LOGGER.debug("http connection connected, local:... | HttpClientPoolFactory implements ClientPoolFactory<HttpClientWithContext> { @Override public HttpClientWithContext createClientPool(Context context) { HttpClient httpClient = context.owner().createHttpClient(httpClientOptions); httpClient.connectionHandler(connection -> { LOGGER.debug("http connection connected, local:... | HttpClientPoolFactory implements ClientPoolFactory<HttpClientWithContext> { @Override public HttpClientWithContext createClientPool(Context context) { HttpClient httpClient = context.owner().createHttpClient(httpClientOptions); httpClient.connectionHandler(connection -> { LOGGER.debug("http connection connected, local:... | HttpClientPoolFactory implements ClientPoolFactory<HttpClientWithContext> { @Override public HttpClientWithContext createClientPool(Context context) { HttpClient httpClient = context.owner().createHttpClient(httpClientOptions); httpClient.connectionHandler(connection -> { LOGGER.debug("http connection connected, local:... |
@Test public void createLogin() { Assert.assertNull(tcpClientConnection.createLogin()); } | protected TcpOutputStream createLogin() { return null; } | TcpClientConnection extends TcpConnection { protected TcpOutputStream createLogin() { return null; } } | TcpClientConnection extends TcpConnection { protected TcpOutputStream createLogin() { return null; } TcpClientConnection(Context context, NetClientWrapper netClientWrapper, String strEndpoint); } | TcpClientConnection extends TcpConnection { protected TcpOutputStream createLogin() { return null; } TcpClientConnection(Context context, NetClientWrapper netClientWrapper, String strEndpoint); boolean isLocalSupportLogin(); TcpClientConfig getClientConfig(); void setLocalSupportLogin(boolean localSupportLogin); void s... | TcpClientConnection extends TcpConnection { protected TcpOutputStream createLogin() { return null; } TcpClientConnection(Context context, NetClientWrapper netClientWrapper, String strEndpoint); boolean isLocalSupportLogin(); TcpClientConfig getClientConfig(); void setLocalSupportLogin(boolean localSupportLogin); void s... |
@Test public void onLoginResponse_buffer() { Assert.assertTrue(tcpClientConnection.onLoginResponse(null)); } | protected boolean onLoginResponse(Buffer bodyBuffer) { return true; } | TcpClientConnection extends TcpConnection { protected boolean onLoginResponse(Buffer bodyBuffer) { return true; } } | TcpClientConnection extends TcpConnection { protected boolean onLoginResponse(Buffer bodyBuffer) { return true; } TcpClientConnection(Context context, NetClientWrapper netClientWrapper, String strEndpoint); } | TcpClientConnection extends TcpConnection { protected boolean onLoginResponse(Buffer bodyBuffer) { return true; } TcpClientConnection(Context context, NetClientWrapper netClientWrapper, String strEndpoint); boolean isLocalSupportLogin(); TcpClientConfig getClientConfig(); void setLocalSupportLogin(boolean localSupportL... | TcpClientConnection extends TcpConnection { protected boolean onLoginResponse(Buffer bodyBuffer) { return true; } TcpClientConnection(Context context, NetClientWrapper netClientWrapper, String strEndpoint); boolean isLocalSupportLogin(); TcpClientConfig getClientConfig(); void setLocalSupportLogin(boolean localSupportL... |
@Test public void testDefaultValues() { Assert.assertNull(oCreateServiceRequest.getService()); } | public Microservice getService() { return service; } | CreateServiceRequest { public Microservice getService() { return service; } } | CreateServiceRequest { public Microservice getService() { return service; } } | CreateServiceRequest { public Microservice getService() { return service; } Microservice getService(); void setService(Microservice service); } | CreateServiceRequest { public Microservice getService() { return service; } Microservice getService(); void setService(Microservice service); } |
@Test public void testCalcMeasurements(@Mocked Id id, @Mocked Runtime runtime, @Mocked RuntimeMXBean mxBean, @Mocked CharSource charSource) throws IOException { List<Measurement> measurements = new ArrayList<>(); new MockUp<Files>() { @Mock public CharSource asCharSource(File file, Charset encoding) { return charSource... | public void calcMeasurements(List<Measurement> measurements, long msNow) { update(); measurements.add(new Measurement(allCpuUsage.getId(), msNow, allCpuUsage.getUsage())); measurements.add(new Measurement(processCpuUsage.getId(), msNow, processCpuUsage.getUsage())); } | CpuMeter { public void calcMeasurements(List<Measurement> measurements, long msNow) { update(); measurements.add(new Measurement(allCpuUsage.getId(), msNow, allCpuUsage.getUsage())); measurements.add(new Measurement(processCpuUsage.getId(), msNow, processCpuUsage.getUsage())); } } | CpuMeter { public void calcMeasurements(List<Measurement> measurements, long msNow) { update(); measurements.add(new Measurement(allCpuUsage.getId(), msNow, allCpuUsage.getUsage())); measurements.add(new Measurement(processCpuUsage.getId(), msNow, processCpuUsage.getUsage())); } CpuMeter(Id id); } | CpuMeter { public void calcMeasurements(List<Measurement> measurements, long msNow) { update(); measurements.add(new Measurement(allCpuUsage.getId(), msNow, allCpuUsage.getUsage())); measurements.add(new Measurement(processCpuUsage.getId(), msNow, processCpuUsage.getUsage())); } CpuMeter(Id id); void calcMeasurements(L... | CpuMeter { public void calcMeasurements(List<Measurement> measurements, long msNow) { update(); measurements.add(new Measurement(allCpuUsage.getId(), msNow, allCpuUsage.getUsage())); measurements.add(new Measurement(processCpuUsage.getId(), msNow, processCpuUsage.getUsage())); } CpuMeter(Id id); void calcMeasurements(L... |
@Test public void send_inWorkingStatus(@Mocked AbstractTcpClientPackage tcpClientPackage, @Mocked TcpOutputStream tcpOutputStream) { Deencapsulation.setField(tcpClientConnection, "status", Status.WORKING); long msgId = 1; ByteBuf byteBuf = Unpooled.buffer(); new Expectations(tcpClientConnection) { { tcpClientPackage.ge... | public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContext(v -> { if (!writeToBufferQueue(tcpClientPa... | TcpClientConnection extends TcpConnection { public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContex... | TcpClientConnection extends TcpConnection { public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContex... | TcpClientConnection extends TcpConnection { public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContex... | TcpClientConnection extends TcpConnection { public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContex... |
@Test public void send_inDisconnectedStatus(@Mocked AbstractTcpClientPackage tcpClientPackage, @Mocked TcpOutputStream tcpOutputStream) { long msgId = 1; new Expectations(tcpClientConnection) { { tcpClientPackage.getMsgId(); result = msgId; } }; new MockUp<Context>(context) { @Mock void runOnContext(Handler<Void> actio... | public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContext(v -> { if (!writeToBufferQueue(tcpClientPa... | TcpClientConnection extends TcpConnection { public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContex... | TcpClientConnection extends TcpConnection { public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContex... | TcpClientConnection extends TcpConnection { public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContex... | TcpClientConnection extends TcpConnection { public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContex... |
@Test public void send_disconnectedToTryLogin(@Mocked AbstractTcpClientPackage tcpClientPackage, @Mocked TcpOutputStream tcpOutputStream) { long msgId = 1; new Expectations(tcpClientConnection) { { tcpClientPackage.getMsgId(); result = msgId; } }; new MockUp<Context>(context) { @Mock void runOnContext(Handler<Void> act... | public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContext(v -> { if (!writeToBufferQueue(tcpClientPa... | TcpClientConnection extends TcpConnection { public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContex... | TcpClientConnection extends TcpConnection { public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContex... | TcpClientConnection extends TcpConnection { public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContex... | TcpClientConnection extends TcpConnection { public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContex... |
@Test public void send_disconnectedToWorking(@Mocked AbstractTcpClientPackage tcpClientPackage, @Mocked TcpOutputStream tcpOutputStream) { long msgId = 1; new Expectations(tcpClientConnection) { { tcpClientPackage.getMsgId(); result = msgId; tcpClientConnection.write((ByteBuf) any); } }; new MockUp<Context>(context) { ... | public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContext(v -> { if (!writeToBufferQueue(tcpClientPa... | TcpClientConnection extends TcpConnection { public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContex... | TcpClientConnection extends TcpConnection { public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContex... | TcpClientConnection extends TcpConnection { public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContex... | TcpClientConnection extends TcpConnection { public void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) { requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(tcpClientPackage.getMsRequestTimeout(), callback)); if (writeToBufferQueue(tcpClientPackage)) { return; } context.runOnContex... |
@Test public void connect_success(@Mocked NetSocketImpl netSocket) { FutureFactoryImpl futureFactory = new FutureFactoryImpl(); new MockUp<NetClientWrapper>(netClientWrapper) { @Mock void connect(boolean ssl, int port, String host, Handler<AsyncResult<NetSocket>> connectHandler) { connectHandler.handle(futureFactory.su... | @VisibleForTesting protected void connect() { this.status = Status.CONNECTING; LOGGER.info("connecting to address {}", socketAddress.toString()); netClientWrapper.connect(endpoint.isSslEnabled(), socketAddress.getPort(), socketAddress.getHostString(), ar -> { if (ar.succeeded()) { onConnectSuccess(ar.result()); return;... | TcpClientConnection extends TcpConnection { @VisibleForTesting protected void connect() { this.status = Status.CONNECTING; LOGGER.info("connecting to address {}", socketAddress.toString()); netClientWrapper.connect(endpoint.isSslEnabled(), socketAddress.getPort(), socketAddress.getHostString(), ar -> { if (ar.succeeded... | TcpClientConnection extends TcpConnection { @VisibleForTesting protected void connect() { this.status = Status.CONNECTING; LOGGER.info("connecting to address {}", socketAddress.toString()); netClientWrapper.connect(endpoint.isSslEnabled(), socketAddress.getPort(), socketAddress.getHostString(), ar -> { if (ar.succeeded... | TcpClientConnection extends TcpConnection { @VisibleForTesting protected void connect() { this.status = Status.CONNECTING; LOGGER.info("connecting to address {}", socketAddress.toString()); netClientWrapper.connect(endpoint.isSslEnabled(), socketAddress.getPort(), socketAddress.getHostString(), ar -> { if (ar.succeeded... | TcpClientConnection extends TcpConnection { @VisibleForTesting protected void connect() { this.status = Status.CONNECTING; LOGGER.info("connecting to address {}", socketAddress.toString()); netClientWrapper.connect(endpoint.isSslEnabled(), socketAddress.getPort(), socketAddress.getHostString(), ar -> { if (ar.succeeded... |
@Test public void connect_failed() { requestMap.put(10L, new TcpRequest(10, ar -> { })); FutureFactoryImpl futureFactory = new FutureFactoryImpl(); RuntimeException error = new RuntimeExceptionWithoutStackTrace(); new MockUp<NetClientWrapper>(netClientWrapper) { @Mock void connect(boolean ssl, int port, String host, Ha... | @VisibleForTesting protected void connect() { this.status = Status.CONNECTING; LOGGER.info("connecting to address {}", socketAddress.toString()); netClientWrapper.connect(endpoint.isSslEnabled(), socketAddress.getPort(), socketAddress.getHostString(), ar -> { if (ar.succeeded()) { onConnectSuccess(ar.result()); return;... | TcpClientConnection extends TcpConnection { @VisibleForTesting protected void connect() { this.status = Status.CONNECTING; LOGGER.info("connecting to address {}", socketAddress.toString()); netClientWrapper.connect(endpoint.isSslEnabled(), socketAddress.getPort(), socketAddress.getHostString(), ar -> { if (ar.succeeded... | TcpClientConnection extends TcpConnection { @VisibleForTesting protected void connect() { this.status = Status.CONNECTING; LOGGER.info("connecting to address {}", socketAddress.toString()); netClientWrapper.connect(endpoint.isSslEnabled(), socketAddress.getPort(), socketAddress.getHostString(), ar -> { if (ar.succeeded... | TcpClientConnection extends TcpConnection { @VisibleForTesting protected void connect() { this.status = Status.CONNECTING; LOGGER.info("connecting to address {}", socketAddress.toString()); netClientWrapper.connect(endpoint.isSslEnabled(), socketAddress.getPort(), socketAddress.getHostString(), ar -> { if (ar.succeeded... | TcpClientConnection extends TcpConnection { @VisibleForTesting protected void connect() { this.status = Status.CONNECTING; LOGGER.info("connecting to address {}", socketAddress.toString()); netClientWrapper.connect(endpoint.isSslEnabled(), socketAddress.getPort(), socketAddress.getHostString(), ar -> { if (ar.succeeded... |
@Test public void onClosed(@Mocked NetSocketImpl netSocket) { requestMap.put(10L, new TcpRequest(10, ar -> { })); tcpClientConnection.initNetSocket(netSocket); Deencapsulation.invoke(tcpClientConnection, "onClosed", new Class<?>[] {Void.class}, new Object[] {null}); Assert.assertEquals(Status.DISCONNECTED, Deencapsulat... | private void onClosed(Void v) { onDisconnected(new IOException("socket closed")); } | TcpClientConnection extends TcpConnection { private void onClosed(Void v) { onDisconnected(new IOException("socket closed")); } } | TcpClientConnection extends TcpConnection { private void onClosed(Void v) { onDisconnected(new IOException("socket closed")); } TcpClientConnection(Context context, NetClientWrapper netClientWrapper, String strEndpoint); } | TcpClientConnection extends TcpConnection { private void onClosed(Void v) { onDisconnected(new IOException("socket closed")); } TcpClientConnection(Context context, NetClientWrapper netClientWrapper, String strEndpoint); boolean isLocalSupportLogin(); TcpClientConfig getClientConfig(); void setLocalSupportLogin(boolean... | TcpClientConnection extends TcpConnection { private void onClosed(Void v) { onDisconnected(new IOException("socket closed")); } TcpClientConnection(Context context, NetClientWrapper netClientWrapper, String strEndpoint); boolean isLocalSupportLogin(); TcpClientConfig getClientConfig(); void setLocalSupportLogin(boolean... |
@Test public void onReply_notExist() { tcpClientConnection.onReply(1, null, null); } | protected void onReply(long msgId, Buffer headerBuffer, Buffer bodyBuffer) { TcpRequest request = requestMap.remove(msgId); if (request == null) { LOGGER.error("Unknown reply msgId {}, waiting count {}", msgId, requestMap.size()); return; } request.onReply(headerBuffer, bodyBuffer); } | TcpClientConnection extends TcpConnection { protected void onReply(long msgId, Buffer headerBuffer, Buffer bodyBuffer) { TcpRequest request = requestMap.remove(msgId); if (request == null) { LOGGER.error("Unknown reply msgId {}, waiting count {}", msgId, requestMap.size()); return; } request.onReply(headerBuffer, bodyB... | TcpClientConnection extends TcpConnection { protected void onReply(long msgId, Buffer headerBuffer, Buffer bodyBuffer) { TcpRequest request = requestMap.remove(msgId); if (request == null) { LOGGER.error("Unknown reply msgId {}, waiting count {}", msgId, requestMap.size()); return; } request.onReply(headerBuffer, bodyB... | TcpClientConnection extends TcpConnection { protected void onReply(long msgId, Buffer headerBuffer, Buffer bodyBuffer) { TcpRequest request = requestMap.remove(msgId); if (request == null) { LOGGER.error("Unknown reply msgId {}, waiting count {}", msgId, requestMap.size()); return; } request.onReply(headerBuffer, bodyB... | TcpClientConnection extends TcpConnection { protected void onReply(long msgId, Buffer headerBuffer, Buffer bodyBuffer) { TcpRequest request = requestMap.remove(msgId); if (request == null) { LOGGER.error("Unknown reply msgId {}, waiting count {}", msgId, requestMap.size()); return; } request.onReply(headerBuffer, bodyB... |
@Test public void on_exist() { long msgId = 1L; AtomicInteger count = new AtomicInteger(); requestMap.put(msgId, new TcpRequest(10, ar -> { count.incrementAndGet(); })); tcpClientConnection.onReply(msgId, null, null); Assert.assertEquals(1, count.get()); } | protected void onReply(long msgId, Buffer headerBuffer, Buffer bodyBuffer) { TcpRequest request = requestMap.remove(msgId); if (request == null) { LOGGER.error("Unknown reply msgId {}, waiting count {}", msgId, requestMap.size()); return; } request.onReply(headerBuffer, bodyBuffer); } | TcpClientConnection extends TcpConnection { protected void onReply(long msgId, Buffer headerBuffer, Buffer bodyBuffer) { TcpRequest request = requestMap.remove(msgId); if (request == null) { LOGGER.error("Unknown reply msgId {}, waiting count {}", msgId, requestMap.size()); return; } request.onReply(headerBuffer, bodyB... | TcpClientConnection extends TcpConnection { protected void onReply(long msgId, Buffer headerBuffer, Buffer bodyBuffer) { TcpRequest request = requestMap.remove(msgId); if (request == null) { LOGGER.error("Unknown reply msgId {}, waiting count {}", msgId, requestMap.size()); return; } request.onReply(headerBuffer, bodyB... | TcpClientConnection extends TcpConnection { protected void onReply(long msgId, Buffer headerBuffer, Buffer bodyBuffer) { TcpRequest request = requestMap.remove(msgId); if (request == null) { LOGGER.error("Unknown reply msgId {}, waiting count {}", msgId, requestMap.size()); return; } request.onReply(headerBuffer, bodyB... | TcpClientConnection extends TcpConnection { protected void onReply(long msgId, Buffer headerBuffer, Buffer bodyBuffer) { TcpRequest request = requestMap.remove(msgId); if (request == null) { LOGGER.error("Unknown reply msgId {}, waiting count {}", msgId, requestMap.size()); return; } request.onReply(headerBuffer, bodyB... |
@Test public void createClientPool() { Vertx vertx = Mockito.mock(Vertx.class); Context context = Mockito.mock(Context.class); Mockito.when(context.owner()).thenReturn(vertx); TcpClientConnectionPool pool = factory.createClientPool(context); Assert.assertSame(normalClientConfig, pool.netClientWrapper.getClientConfig(fa... | @Override public CLIENT_POOL createClientPool(Context context) { Vertx vertx = context.owner(); NetClientWrapper netClientWrapper = new NetClientWrapper(vertx, normalClientConfig, sslClientConfig); return doCreateClientPool(context, netClientWrapper); } | AbstractTcpClientPoolFactory implements ClientPoolFactory<CLIENT_POOL> { @Override public CLIENT_POOL createClientPool(Context context) { Vertx vertx = context.owner(); NetClientWrapper netClientWrapper = new NetClientWrapper(vertx, normalClientConfig, sslClientConfig); return doCreateClientPool(context, netClientWrapp... | AbstractTcpClientPoolFactory implements ClientPoolFactory<CLIENT_POOL> { @Override public CLIENT_POOL createClientPool(Context context) { Vertx vertx = context.owner(); NetClientWrapper netClientWrapper = new NetClientWrapper(vertx, normalClientConfig, sslClientConfig); return doCreateClientPool(context, netClientWrapp... | AbstractTcpClientPoolFactory implements ClientPoolFactory<CLIENT_POOL> { @Override public CLIENT_POOL createClientPool(Context context) { Vertx vertx = context.owner(); NetClientWrapper netClientWrapper = new NetClientWrapper(vertx, normalClientConfig, sslClientConfig); return doCreateClientPool(context, netClientWrapp... | AbstractTcpClientPoolFactory implements ClientPoolFactory<CLIENT_POOL> { @Override public CLIENT_POOL createClientPool(Context context) { Vertx vertx = context.owner(); NetClientWrapper netClientWrapper = new NetClientWrapper(vertx, normalClientConfig, sslClientConfig); return doCreateClientPool(context, netClientWrapp... |
@Test public void testInitializedValues() { initCreateServiceRequest(); Assert.assertEquals(oMockMicroservice, oCreateServiceRequest.getService()); } | public Microservice getService() { return service; } | CreateServiceRequest { public Microservice getService() { return service; } } | CreateServiceRequest { public Microservice getService() { return service; } } | CreateServiceRequest { public Microservice getService() { return service; } Microservice getService(); void setService(Microservice service); } | CreateServiceRequest { public Microservice getService() { return service; } Microservice getService(); void setService(Microservice service); } |
@Test public void create() { Assert.assertThat(pool.create("rest: } | @Override protected TcpClientConnection create(String endpoint) { return new TcpClientConnection(context, netClientWrapper, endpoint); } | TcpClientConnectionPool extends AbstractTcpClientConnectionPool<TcpClientConnection> { @Override protected TcpClientConnection create(String endpoint) { return new TcpClientConnection(context, netClientWrapper, endpoint); } } | TcpClientConnectionPool extends AbstractTcpClientConnectionPool<TcpClientConnection> { @Override protected TcpClientConnection create(String endpoint) { return new TcpClientConnection(context, netClientWrapper, endpoint); } TcpClientConnectionPool(Context context, NetClientWrapper netClientWrapper); } | TcpClientConnectionPool extends AbstractTcpClientConnectionPool<TcpClientConnection> { @Override protected TcpClientConnection create(String endpoint) { return new TcpClientConnection(context, netClientWrapper, endpoint); } TcpClientConnectionPool(Context context, NetClientWrapper netClientWrapper); } | TcpClientConnectionPool extends AbstractTcpClientConnectionPool<TcpClientConnection> { @Override protected TcpClientConnection create(String endpoint) { return new TcpClientConnection(context, netClientWrapper, endpoint); } TcpClientConnectionPool(Context context, NetClientWrapper netClientWrapper); } |
@Test public void testTcpClientConfig() { TcpClientConfig config = new TcpClientConfig(); Assert.assertEquals(config.getMsLoginTimeout(), 30000); Assert.assertEquals(config.isSsl(), false); config.setMsLoginTimeout(500); Assert.assertEquals(config.getMsLoginTimeout(), 500); } | public TcpClientConfig() { msLoginTimeout = DEFAULT_LOGIN_TIMEOUT; } | TcpClientConfig extends NetClientOptions { public TcpClientConfig() { msLoginTimeout = DEFAULT_LOGIN_TIMEOUT; } } | TcpClientConfig extends NetClientOptions { public TcpClientConfig() { msLoginTimeout = DEFAULT_LOGIN_TIMEOUT; } TcpClientConfig(); } | TcpClientConfig extends NetClientOptions { public TcpClientConfig() { msLoginTimeout = DEFAULT_LOGIN_TIMEOUT; } TcpClientConfig(); long getMsLoginTimeout(); void setMsLoginTimeout(long msLoginTimeout); } | TcpClientConfig extends NetClientOptions { public TcpClientConfig() { msLoginTimeout = DEFAULT_LOGIN_TIMEOUT; } TcpClientConfig(); long getMsLoginTimeout(); void setMsLoginTimeout(long msLoginTimeout); static final int DEFAULT_LOGIN_TIMEOUT; } |
@Test public void getClientConfig() { Assert.assertSame(normalClientConfig, netClientWrapper.getClientConfig(false)); Assert.assertSame(sslClientConfig, netClientWrapper.getClientConfig(true)); } | public TcpClientConfig getClientConfig(boolean ssl) { if (ssl) { return sslClientConfig; } return normalClientConfig; } | NetClientWrapper { public TcpClientConfig getClientConfig(boolean ssl) { if (ssl) { return sslClientConfig; } return normalClientConfig; } } | NetClientWrapper { public TcpClientConfig getClientConfig(boolean ssl) { if (ssl) { return sslClientConfig; } return normalClientConfig; } NetClientWrapper(Vertx vertx, TcpClientConfig normalClientConfig, TcpClientConfig sslClientConfig); } | NetClientWrapper { public TcpClientConfig getClientConfig(boolean ssl) { if (ssl) { return sslClientConfig; } return normalClientConfig; } NetClientWrapper(Vertx vertx, TcpClientConfig normalClientConfig, TcpClientConfig sslClientConfig); TcpClientConfig getClientConfig(boolean ssl); void connect(boolean ssl, int port,... | NetClientWrapper { public TcpClientConfig getClientConfig(boolean ssl) { if (ssl) { return sslClientConfig; } return normalClientConfig; } NetClientWrapper(Vertx vertx, TcpClientConfig normalClientConfig, TcpClientConfig sslClientConfig); TcpClientConfig getClientConfig(boolean ssl); void connect(boolean ssl, int port,... |
@Test public void connect(@Mocked NetSocket normalSocket, @Mocked NetSocket sslSocket) { int port = 8000; String host = "localhost"; FutureFactoryImpl futureFactory = new FutureFactoryImpl(); new MockUp<NetClient>(normalNetClient) { @Mock NetClient connect(int port, String host, Handler<AsyncResult<NetSocket>> connectH... | public void connect(boolean ssl, int port, String host, Handler<AsyncResult<NetSocket>> connectHandler) { if (ssl) { sslNetClient.connect(port, host, connectHandler); return; } normalNetClient.connect(port, host, connectHandler); } | NetClientWrapper { public void connect(boolean ssl, int port, String host, Handler<AsyncResult<NetSocket>> connectHandler) { if (ssl) { sslNetClient.connect(port, host, connectHandler); return; } normalNetClient.connect(port, host, connectHandler); } } | NetClientWrapper { public void connect(boolean ssl, int port, String host, Handler<AsyncResult<NetSocket>> connectHandler) { if (ssl) { sslNetClient.connect(port, host, connectHandler); return; } normalNetClient.connect(port, host, connectHandler); } NetClientWrapper(Vertx vertx, TcpClientConfig normalClientConfig, Tcp... | NetClientWrapper { public void connect(boolean ssl, int port, String host, Handler<AsyncResult<NetSocket>> connectHandler) { if (ssl) { sslNetClient.connect(port, host, connectHandler); return; } normalNetClient.connect(port, host, connectHandler); } NetClientWrapper(Vertx vertx, TcpClientConfig normalClientConfig, Tcp... | NetClientWrapper { public void connect(boolean ssl, int port, String host, Handler<AsyncResult<NetSocket>> connectHandler) { if (ssl) { sslNetClient.connect(port, host, connectHandler); return; } normalNetClient.connect(port, host, connectHandler); } NetClientWrapper(Vertx vertx, TcpClientConfig normalClientConfig, Tcp... |
@Test public void start(@Mocked Context context) throws Exception { AtomicInteger count = new AtomicInteger(); ClientPoolManager<HttpClientWithContext> clientMgr = new MockUp<ClientPoolManager<HttpClientWithContext>>() { @Mock HttpClientWithContext createClientPool(Context context) { count.incrementAndGet(); return nul... | @SuppressWarnings("unchecked") @Override public void start() throws Exception { try { ClientPoolManager<CLIENT_POOL> clientMgr = (ClientPoolManager<CLIENT_POOL>) config().getValue(CLIENT_MGR); clientMgr.createClientPool(context); } catch (Throwable e) { LOGGER.error("", e); throw e; } } | ClientVerticle extends AbstractVerticle { @SuppressWarnings("unchecked") @Override public void start() throws Exception { try { ClientPoolManager<CLIENT_POOL> clientMgr = (ClientPoolManager<CLIENT_POOL>) config().getValue(CLIENT_MGR); clientMgr.createClientPool(context); } catch (Throwable e) { LOGGER.error("", e); thr... | ClientVerticle extends AbstractVerticle { @SuppressWarnings("unchecked") @Override public void start() throws Exception { try { ClientPoolManager<CLIENT_POOL> clientMgr = (ClientPoolManager<CLIENT_POOL>) config().getValue(CLIENT_MGR); clientMgr.createClientPool(context); } catch (Throwable e) { LOGGER.error("", e); thr... | ClientVerticle extends AbstractVerticle { @SuppressWarnings("unchecked") @Override public void start() throws Exception { try { ClientPoolManager<CLIENT_POOL> clientMgr = (ClientPoolManager<CLIENT_POOL>) config().getValue(CLIENT_MGR); clientMgr.createClientPool(context); } catch (Throwable e) { LOGGER.error("", e); thr... | ClientVerticle extends AbstractVerticle { @SuppressWarnings("unchecked") @Override public void start() throws Exception { try { ClientPoolManager<CLIENT_POOL> clientMgr = (ClientPoolManager<CLIENT_POOL>) config().getValue(CLIENT_MGR); clientMgr.createClientPool(context); } catch (Throwable e) { LOGGER.error("", e); thr... |
@Test public void test() throws UnsupportedEncodingException { TcpBufferHandler output = new TcpBufferHandler() { @Override public void handle(long _msgId, Buffer _headerBuffer, Buffer _bodyBuffer) { msgId = _msgId; headerBuffer = _headerBuffer; bodyBuffer = _bodyBuffer; } }; byte[] header = new byte[] {1, 2, 3}; byte[... | public void handle(Buffer buf) { parser.handle(buf); } | TcpParser implements Handler<Buffer> { public void handle(Buffer buf) { parser.handle(buf); } } | TcpParser implements Handler<Buffer> { public void handle(Buffer buf) { parser.handle(buf); } TcpParser(TcpBufferHandler output); } | TcpParser implements Handler<Buffer> { public void handle(Buffer buf) { parser.handle(buf); } TcpParser(TcpBufferHandler output); boolean firstNEqual(byte[] a, byte[] b, int n); void handle(Buffer buf); } | TcpParser implements Handler<Buffer> { public void handle(Buffer buf) { parser.handle(buf); } TcpParser(TcpBufferHandler output); boolean firstNEqual(byte[] a, byte[] b, int n); void handle(Buffer buf); static final byte[] TCP_MAGIC; static final int TCP_MAX_REQUEST_LENGTH; static final int TCP_HEADER_LENGTH; } |
@SuppressWarnings({"rawtypes", "unchecked"}) @Test public void testTcpServerNonSSL(@Mocked Vertx vertx, @Mocked AsyncResultCallback<InetSocketAddress> callback, @Mocked NetServer netServer) { new Expectations() { { vertx.createNetServer(); result = netServer; netServer.connectHandler((Handler) any); netServer.listen(an... | public void init(Vertx vertx, String sslKey, AsyncResultCallback<InetSocketAddress> callback) { NetServer netServer; if (endpointObject.isSslEnabled()) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslK... | TcpServer { public void init(Vertx vertx, String sslKey, AsyncResultCallback<InetSocketAddress> callback) { NetServer netServer; if (endpointObject.isSslEnabled()) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildF... | TcpServer { public void init(Vertx vertx, String sslKey, AsyncResultCallback<InetSocketAddress> callback) { NetServer netServer; if (endpointObject.isSslEnabled()) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildF... | TcpServer { public void init(Vertx vertx, String sslKey, AsyncResultCallback<InetSocketAddress> callback) { NetServer netServer; if (endpointObject.isSslEnabled()) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildF... | TcpServer { public void init(Vertx vertx, String sslKey, AsyncResultCallback<InetSocketAddress> callback) { NetServer netServer; if (endpointObject.isSslEnabled()) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildF... |
@SuppressWarnings({"rawtypes", "unchecked"}) @Test public void testTcpServerSSL(@Mocked Vertx vertx, @Mocked AsyncResultCallback<InetSocketAddress> callback, @Mocked NetServer netServer) { new Expectations() { { vertx.createNetServer((NetServerOptions) any); result = netServer; netServer.connectHandler((Handler) any); ... | public void init(Vertx vertx, String sslKey, AsyncResultCallback<InetSocketAddress> callback) { NetServer netServer; if (endpointObject.isSslEnabled()) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslK... | TcpServer { public void init(Vertx vertx, String sslKey, AsyncResultCallback<InetSocketAddress> callback) { NetServer netServer; if (endpointObject.isSslEnabled()) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildF... | TcpServer { public void init(Vertx vertx, String sslKey, AsyncResultCallback<InetSocketAddress> callback) { NetServer netServer; if (endpointObject.isSslEnabled()) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildF... | TcpServer { public void init(Vertx vertx, String sslKey, AsyncResultCallback<InetSocketAddress> callback) { NetServer netServer; if (endpointObject.isSslEnabled()) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildF... | TcpServer { public void init(Vertx vertx, String sslKey, AsyncResultCallback<InetSocketAddress> callback) { NetServer netServer; if (endpointObject.isSslEnabled()) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildF... |
@SuppressWarnings({"rawtypes", "unchecked"}) @Test public void testConnectionLimit(@Mocked Vertx vertx, @Mocked AsyncResultCallback<InetSocketAddress> callback, @Mocked NetServer netServer, @Mocked NetSocketImpl netSocket) { DefaultServerEndpointMetric endpointMetric = new DefaultServerEndpointMetric(null); DefaultTcpS... | public void init(Vertx vertx, String sslKey, AsyncResultCallback<InetSocketAddress> callback) { NetServer netServer; if (endpointObject.isSslEnabled()) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslK... | TcpServer { public void init(Vertx vertx, String sslKey, AsyncResultCallback<InetSocketAddress> callback) { NetServer netServer; if (endpointObject.isSslEnabled()) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildF... | TcpServer { public void init(Vertx vertx, String sslKey, AsyncResultCallback<InetSocketAddress> callback) { NetServer netServer; if (endpointObject.isSslEnabled()) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildF... | TcpServer { public void init(Vertx vertx, String sslKey, AsyncResultCallback<InetSocketAddress> callback) { NetServer netServer; if (endpointObject.isSslEnabled()) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildF... | TcpServer { public void init(Vertx vertx, String sslKey, AsyncResultCallback<InetSocketAddress> callback) { NetServer netServer; if (endpointObject.isSslEnabled()) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildF... |
@Test public void test(@Mocked NetSocketImpl netSocket) { TcpServerConnection connection = new TcpServerConnection(); connection.setProtocol("p"); connection.setZipName("z"); connection.init(netSocket); Assert.assertEquals(netSocket, connection.getNetSocket()); } | public void init(NetSocket netSocket) { this.initNetSocket((NetSocketImpl) netSocket); String remoteAddress = netSocket.remoteAddress().toString(); LOGGER.info("connect from {}, in thread {}", remoteAddress, Thread.currentThread().getName()); netSocket.exceptionHandler(e -> { LOGGER.error("disconected from {}, in threa... | TcpServerConnection extends TcpConnection { public void init(NetSocket netSocket) { this.initNetSocket((NetSocketImpl) netSocket); String remoteAddress = netSocket.remoteAddress().toString(); LOGGER.info("connect from {}, in thread {}", remoteAddress, Thread.currentThread().getName()); netSocket.exceptionHandler(e -> {... | TcpServerConnection extends TcpConnection { public void init(NetSocket netSocket) { this.initNetSocket((NetSocketImpl) netSocket); String remoteAddress = netSocket.remoteAddress().toString(); LOGGER.info("connect from {}, in thread {}", remoteAddress, Thread.currentThread().getName()); netSocket.exceptionHandler(e -> {... | TcpServerConnection extends TcpConnection { public void init(NetSocket netSocket) { this.initNetSocket((NetSocketImpl) netSocket); String remoteAddress = netSocket.remoteAddress().toString(); LOGGER.info("connect from {}, in thread {}", remoteAddress, Thread.currentThread().getName()); netSocket.exceptionHandler(e -> {... | TcpServerConnection extends TcpConnection { public void init(NetSocket netSocket) { this.initNetSocket((NetSocketImpl) netSocket); String remoteAddress = netSocket.remoteAddress().toString(); LOGGER.info("connect from {}, in thread {}", remoteAddress, Thread.currentThread().getName()); netSocket.exceptionHandler(e -> {... |
@Test public void testDefaultValues() { Assert.assertNull(oCreateServiceResponse.getServiceId()); } | public String getServiceId() { return serviceId; } | CreateServiceResponse { public String getServiceId() { return serviceId; } } | CreateServiceResponse { public String getServiceId() { return serviceId; } } | CreateServiceResponse { public String getServiceId() { return serviceId; } String getServiceId(); void setServiceId(String serviceId); } | CreateServiceResponse { public String getServiceId() { return serviceId; } String getServiceId(); void setServiceId(String serviceId); } |
@Test public void testbuildHttpServerOptions() { SSLOption option = SSLOption.buildFromYaml("rest.provider"); SSLCustom custom = SSLCustom.createSSLCustom(option.getSslCustomClass()); HttpServerOptions serverOptions = new HttpServerOptions(); VertxTLSBuilder.buildNetServerOptions(option, custom, serverOptions); Assert.... | public static NetServerOptions buildNetServerOptions(SSLOption sslOption, SSLCustom sslCustom, NetServerOptions netServerOptions) { buildTCPSSLOptions(sslOption, sslCustom, netServerOptions); if (sslOption.isAuthPeer()) { netServerOptions.setClientAuth(ClientAuth.REQUIRED); } else { netServerOptions.setClientAuth(Clien... | VertxTLSBuilder { public static NetServerOptions buildNetServerOptions(SSLOption sslOption, SSLCustom sslCustom, NetServerOptions netServerOptions) { buildTCPSSLOptions(sslOption, sslCustom, netServerOptions); if (sslOption.isAuthPeer()) { netServerOptions.setClientAuth(ClientAuth.REQUIRED); } else { netServerOptions.s... | VertxTLSBuilder { public static NetServerOptions buildNetServerOptions(SSLOption sslOption, SSLCustom sslCustom, NetServerOptions netServerOptions) { buildTCPSSLOptions(sslOption, sslCustom, netServerOptions); if (sslOption.isAuthPeer()) { netServerOptions.setClientAuth(ClientAuth.REQUIRED); } else { netServerOptions.s... | VertxTLSBuilder { public static NetServerOptions buildNetServerOptions(SSLOption sslOption, SSLCustom sslCustom, NetServerOptions netServerOptions) { buildTCPSSLOptions(sslOption, sslCustom, netServerOptions); if (sslOption.isAuthPeer()) { netServerOptions.setClientAuth(ClientAuth.REQUIRED); } else { netServerOptions.s... | VertxTLSBuilder { public static NetServerOptions buildNetServerOptions(SSLOption sslOption, SSLCustom sslCustom, NetServerOptions netServerOptions) { buildTCPSSLOptions(sslOption, sslCustom, netServerOptions); if (sslOption.isAuthPeer()) { netServerOptions.setClientAuth(ClientAuth.REQUIRED); } else { netServerOptions.s... |
@Test public void testbuildHttpClientOptions_sslKey_noFactory() { HttpClientOptions clientOptions = new HttpClientOptions(); VertxTLSBuilder.buildHttpClientOptions("notExist", clientOptions); Assert.assertTrue(clientOptions.isSsl()); } | public static void buildHttpClientOptions(String sslKey, HttpClientOptions httpClientOptions) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslKey); } else { sslOption = factory.createSSLOption(); } SSL... | VertxTLSBuilder { public static void buildHttpClientOptions(String sslKey, HttpClientOptions httpClientOptions) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslKey); } else { sslOption = factory.create... | VertxTLSBuilder { public static void buildHttpClientOptions(String sslKey, HttpClientOptions httpClientOptions) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslKey); } else { sslOption = factory.create... | VertxTLSBuilder { public static void buildHttpClientOptions(String sslKey, HttpClientOptions httpClientOptions) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslKey); } else { sslOption = factory.create... | VertxTLSBuilder { public static void buildHttpClientOptions(String sslKey, HttpClientOptions httpClientOptions) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslKey); } else { sslOption = factory.create... |
@Test public void testbuildHttpClientOptions_ssl_withFactory() { ArchaiusUtils.setProperty("ssl.exist.sslOptionFactory", SSLOptionFactoryForTest.class.getName()); HttpClientOptions clientOptions = new HttpClientOptions(); VertxTLSBuilder.buildHttpClientOptions("exist", clientOptions); Assert.assertTrue(clientOptions.is... | public static void buildHttpClientOptions(String sslKey, HttpClientOptions httpClientOptions) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslKey); } else { sslOption = factory.createSSLOption(); } SSL... | VertxTLSBuilder { public static void buildHttpClientOptions(String sslKey, HttpClientOptions httpClientOptions) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslKey); } else { sslOption = factory.create... | VertxTLSBuilder { public static void buildHttpClientOptions(String sslKey, HttpClientOptions httpClientOptions) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslKey); } else { sslOption = factory.create... | VertxTLSBuilder { public static void buildHttpClientOptions(String sslKey, HttpClientOptions httpClientOptions) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslKey); } else { sslOption = factory.create... | VertxTLSBuilder { public static void buildHttpClientOptions(String sslKey, HttpClientOptions httpClientOptions) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslKey); } else { sslOption = factory.create... |
@Test public void testbuildHttpClientOptions() { SSLOption option = SSLOption.buildFromYaml("rest.consumer"); SSLCustom custom = SSLCustom.createSSLCustom(option.getSslCustomClass()); HttpClientOptions serverOptions = new HttpClientOptions(); VertxTLSBuilder.buildHttpClientOptions(option, custom, serverOptions); Assert... | public static void buildHttpClientOptions(String sslKey, HttpClientOptions httpClientOptions) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslKey); } else { sslOption = factory.createSSLOption(); } SSL... | VertxTLSBuilder { public static void buildHttpClientOptions(String sslKey, HttpClientOptions httpClientOptions) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslKey); } else { sslOption = factory.create... | VertxTLSBuilder { public static void buildHttpClientOptions(String sslKey, HttpClientOptions httpClientOptions) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslKey); } else { sslOption = factory.create... | VertxTLSBuilder { public static void buildHttpClientOptions(String sslKey, HttpClientOptions httpClientOptions) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslKey); } else { sslOption = factory.create... | VertxTLSBuilder { public static void buildHttpClientOptions(String sslKey, HttpClientOptions httpClientOptions) { SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(sslKey, null); SSLOption sslOption; if (factory == null) { sslOption = SSLOption.buildFromYaml(sslKey); } else { sslOption = factory.create... |
@Test public void testbuildClientOptionsBase() { SSLOption option = SSLOption.buildFromYaml("rest.consumer"); SSLCustom custom = SSLCustom.createSSLCustom(option.getSslCustomClass()); HttpClientOptions serverOptions = new HttpClientOptions(); VertxTLSBuilder.buildClientOptionsBase(option, custom, serverOptions); Assert... | public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAll(true); } return ... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... |
@Test public void testbuildClientOptionsBaseFileNull() { SSLOption option = SSLOption.buildFromYaml("rest.consumer"); option.setKeyStore(null); option.setTrustStore(null); option.setCrl(null); SSLCustom custom = SSLCustom.createSSLCustom(option.getSslCustomClass()); HttpClientOptions serverOptions = new HttpClientOptio... | public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAll(true); } return ... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... |
@Test public void testbuildClientOptionsBaseAuthPeerFalse() { SSLOption option = SSLOption.buildFromYaml("rest.consumer"); SSLCustom custom = SSLCustom.createSSLCustom(option.getSslCustomClass()); HttpClientOptions serverOptions = new HttpClientOptions(); new MockUp<SSLOption>() { @Mock public boolean isAuthPeer() { re... | public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAll(true); } return ... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... |
@Test public void testbuildClientOptionsBaseSTORE_JKS() { SSLOption option = SSLOption.buildFromYaml("rest.consumer"); SSLCustom custom = SSLCustom.createSSLCustom(option.getSslCustomClass()); HttpClientOptions serverOptions = new HttpClientOptions(); new MockUp<SSLOption>() { @Mock public String getKeyStoreType() { re... | public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAll(true); } return ... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... |
@Test public void testbuildClientOptionsBaseSTORE_PKCS12() { SSLOption option = SSLOption.buildFromYaml("rest.consumer"); SSLCustom custom = SSLCustom.createSSLCustom(option.getSslCustomClass()); HttpClientOptions serverOptions = new HttpClientOptions(); new MockUp<SSLOption>() { @Mock public String getTrustStoreType()... | public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAll(true); } return ... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... | VertxTLSBuilder { public static ClientOptionsBase buildClientOptionsBase(SSLOption sslOption, SSLCustom sslCustom, ClientOptionsBase clientOptionsBase) { buildTCPSSLOptions(sslOption, sslCustom, clientOptionsBase); if (sslOption.isAuthPeer()) { clientOptionsBase.setTrustAll(false); } else { clientOptionsBase.setTrustAl... |
@Test public void testbuildHttpServerOptionsRequest() { SSLOption option = SSLOption.buildFromYaml("rest.provider"); SSLCustom custom = SSLCustom.createSSLCustom(option.getSslCustomClass()); HttpServerOptions serverOptions = new HttpServerOptions(); new MockUp<SSLOption>() { @Mock public boolean isAuthPeer() { return f... | public static NetServerOptions buildNetServerOptions(SSLOption sslOption, SSLCustom sslCustom, NetServerOptions netServerOptions) { buildTCPSSLOptions(sslOption, sslCustom, netServerOptions); if (sslOption.isAuthPeer()) { netServerOptions.setClientAuth(ClientAuth.REQUIRED); } else { netServerOptions.setClientAuth(Clien... | VertxTLSBuilder { public static NetServerOptions buildNetServerOptions(SSLOption sslOption, SSLCustom sslCustom, NetServerOptions netServerOptions) { buildTCPSSLOptions(sslOption, sslCustom, netServerOptions); if (sslOption.isAuthPeer()) { netServerOptions.setClientAuth(ClientAuth.REQUIRED); } else { netServerOptions.s... | VertxTLSBuilder { public static NetServerOptions buildNetServerOptions(SSLOption sslOption, SSLCustom sslCustom, NetServerOptions netServerOptions) { buildTCPSSLOptions(sslOption, sslCustom, netServerOptions); if (sslOption.isAuthPeer()) { netServerOptions.setClientAuth(ClientAuth.REQUIRED); } else { netServerOptions.s... | VertxTLSBuilder { public static NetServerOptions buildNetServerOptions(SSLOption sslOption, SSLCustom sslCustom, NetServerOptions netServerOptions) { buildTCPSSLOptions(sslOption, sslCustom, netServerOptions); if (sslOption.isAuthPeer()) { netServerOptions.setClientAuth(ClientAuth.REQUIRED); } else { netServerOptions.s... | VertxTLSBuilder { public static NetServerOptions buildNetServerOptions(SSLOption sslOption, SSLCustom sslCustom, NetServerOptions netServerOptions) { buildTCPSSLOptions(sslOption, sslCustom, netServerOptions); if (sslOption.isAuthPeer()) { netServerOptions.setClientAuth(ClientAuth.REQUIRED); } else { netServerOptions.s... |
@Test public void testInitializedValues() { initFields(); Assert.assertEquals("testServiceId", oCreateServiceResponse.getServiceId()); } | public String getServiceId() { return serviceId; } | CreateServiceResponse { public String getServiceId() { return serviceId; } } | CreateServiceResponse { public String getServiceId() { return serviceId; } } | CreateServiceResponse { public String getServiceId() { return serviceId; } String getServiceId(); void setServiceId(String serviceId); } | CreateServiceResponse { public String getServiceId() { return serviceId; } String getServiceId(); void setServiceId(String serviceId); } |
@Test public void testPutObject() { Object value = new Object(); SimpleJsonObject json = new SimpleJsonObject(); json.put("k", value); Assert.assertSame(value, json.getValue("k")); } | @Override public JsonObject put(String key, Object value) { getMap().put(key, value); return this; } | SimpleJsonObject extends JsonObject { @Override public JsonObject put(String key, Object value) { getMap().put(key, value); return this; } } | SimpleJsonObject extends JsonObject { @Override public JsonObject put(String key, Object value) { getMap().put(key, value); return this; } } | SimpleJsonObject extends JsonObject { @Override public JsonObject put(String key, Object value) { getMap().put(key, value); return this; } @Override JsonObject put(String key, Object value); @Override JsonObject copy(); } | SimpleJsonObject extends JsonObject { @Override public JsonObject put(String key, Object value) { getMap().put(key, value); return this; } @Override JsonObject put(String key, Object value); @Override JsonObject copy(); } |
@Test public void testCopy() { SimpleJsonObject json = new SimpleJsonObject(); Assert.assertSame(json, json.copy()); } | @Override public JsonObject copy() { return this; } | SimpleJsonObject extends JsonObject { @Override public JsonObject copy() { return this; } } | SimpleJsonObject extends JsonObject { @Override public JsonObject copy() { return this; } } | SimpleJsonObject extends JsonObject { @Override public JsonObject copy() { return this; } @Override JsonObject put(String key, Object value); @Override JsonObject copy(); } | SimpleJsonObject extends JsonObject { @Override public JsonObject copy() { return this; } @Override JsonObject put(String key, Object value); @Override JsonObject copy(); } |
@Test public void testMarkerFilter() { MarkerFilter filter = new MarkerFilter(); filter.setMarker("hello"); filter.start(); Assert.assertEquals(filter.getOnMatch(), FilterReply.ACCEPT); Assert.assertEquals(filter.getOnMismatch(), FilterReply.DENY); ILoggingEvent event = Mockito.mock(ILoggingEvent.class); Marker marker ... | public MarkerFilter() { setOnMatch(FilterReply.ACCEPT); setOnMismatch(FilterReply.DENY); } | MarkerFilter extends AbstractMatcherFilter<ILoggingEvent> { public MarkerFilter() { setOnMatch(FilterReply.ACCEPT); setOnMismatch(FilterReply.DENY); } } | MarkerFilter extends AbstractMatcherFilter<ILoggingEvent> { public MarkerFilter() { setOnMatch(FilterReply.ACCEPT); setOnMismatch(FilterReply.DENY); } MarkerFilter(); } | MarkerFilter extends AbstractMatcherFilter<ILoggingEvent> { public MarkerFilter() { setOnMatch(FilterReply.ACCEPT); setOnMismatch(FilterReply.DENY); } MarkerFilter(); @Override FilterReply decide(ILoggingEvent event); void setMarker(String marker); @Override void start(); } | MarkerFilter extends AbstractMatcherFilter<ILoggingEvent> { public MarkerFilter() { setOnMatch(FilterReply.ACCEPT); setOnMismatch(FilterReply.DENY); } MarkerFilter(); @Override FilterReply decide(ILoggingEvent event); void setMarker(String marker); @Override void start(); } |
@Test public void testIsSuccessCode() { Assert.assertTrue(HttpStatus.isSuccess(200)); Assert.assertFalse(HttpStatus.isSuccess(300)); } | public static boolean isSuccess(int code) { return Status.Family.SUCCESSFUL.equals(Status.Family.familyOf(code)); } | HttpStatus implements StatusType { public static boolean isSuccess(int code) { return Status.Family.SUCCESSFUL.equals(Status.Family.familyOf(code)); } } | HttpStatus implements StatusType { public static boolean isSuccess(int code) { return Status.Family.SUCCESSFUL.equals(Status.Family.familyOf(code)); } HttpStatus(final int statusCode, final String reasonPhrase); } | HttpStatus implements StatusType { public static boolean isSuccess(int code) { return Status.Family.SUCCESSFUL.equals(Status.Family.familyOf(code)); } HttpStatus(final int statusCode, final String reasonPhrase); static boolean isSuccess(int code); static boolean isSuccess(StatusType status); @Override int getStatusCode... | HttpStatus implements StatusType { public static boolean isSuccess(int code) { return Status.Family.SUCCESSFUL.equals(Status.Family.familyOf(code)); } HttpStatus(final int statusCode, final String reasonPhrase); static boolean isSuccess(int code); static boolean isSuccess(StatusType status); @Override int getStatusCode... |
@Test public void testIsSuccessType() { Assert.assertTrue(HttpStatus.isSuccess(Status.OK)); Assert.assertFalse(HttpStatus.isSuccess(Status.BAD_REQUEST)); } | public static boolean isSuccess(int code) { return Status.Family.SUCCESSFUL.equals(Status.Family.familyOf(code)); } | HttpStatus implements StatusType { public static boolean isSuccess(int code) { return Status.Family.SUCCESSFUL.equals(Status.Family.familyOf(code)); } } | HttpStatus implements StatusType { public static boolean isSuccess(int code) { return Status.Family.SUCCESSFUL.equals(Status.Family.familyOf(code)); } HttpStatus(final int statusCode, final String reasonPhrase); } | HttpStatus implements StatusType { public static boolean isSuccess(int code) { return Status.Family.SUCCESSFUL.equals(Status.Family.familyOf(code)); } HttpStatus(final int statusCode, final String reasonPhrase); static boolean isSuccess(int code); static boolean isSuccess(StatusType status); @Override int getStatusCode... | HttpStatus implements StatusType { public static boolean isSuccess(int code) { return Status.Family.SUCCESSFUL.equals(Status.Family.familyOf(code)); } HttpStatus(final int statusCode, final String reasonPhrase); static boolean isSuccess(int code); static boolean isSuccess(StatusType status); @Override int getStatusCode... |
@Test public void testGetStatusCode() { HttpStatus status = new HttpStatus(200, "ok"); Assert.assertEquals(200, status.getStatusCode()); } | @Override public int getStatusCode() { return statusCode; } | HttpStatus implements StatusType { @Override public int getStatusCode() { return statusCode; } } | HttpStatus implements StatusType { @Override public int getStatusCode() { return statusCode; } HttpStatus(final int statusCode, final String reasonPhrase); } | HttpStatus implements StatusType { @Override public int getStatusCode() { return statusCode; } HttpStatus(final int statusCode, final String reasonPhrase); static boolean isSuccess(int code); static boolean isSuccess(StatusType status); @Override int getStatusCode(); @Override Family getFamily(); @Override String getRe... | HttpStatus implements StatusType { @Override public int getStatusCode() { return statusCode; } HttpStatus(final int statusCode, final String reasonPhrase); static boolean isSuccess(int code); static boolean isSuccess(StatusType status); @Override int getStatusCode(); @Override Family getFamily(); @Override String getRe... |
@Test public void testGetFamily() { HttpStatus status = new HttpStatus(200, "ok"); Assert.assertEquals(Family.familyOf(200), status.getFamily()); } | @Override public Family getFamily() { return Family.familyOf(statusCode); } | HttpStatus implements StatusType { @Override public Family getFamily() { return Family.familyOf(statusCode); } } | HttpStatus implements StatusType { @Override public Family getFamily() { return Family.familyOf(statusCode); } HttpStatus(final int statusCode, final String reasonPhrase); } | HttpStatus implements StatusType { @Override public Family getFamily() { return Family.familyOf(statusCode); } HttpStatus(final int statusCode, final String reasonPhrase); static boolean isSuccess(int code); static boolean isSuccess(StatusType status); @Override int getStatusCode(); @Override Family getFamily(); @Overr... | HttpStatus implements StatusType { @Override public Family getFamily() { return Family.familyOf(statusCode); } HttpStatus(final int statusCode, final String reasonPhrase); static boolean isSuccess(int code); static boolean isSuccess(StatusType status); @Override int getStatusCode(); @Override Family getFamily(); @Overr... |
@Test public void testGetReasonPhrase() { HttpStatus status = new HttpStatus(200, "ok"); Assert.assertEquals("ok", status.getReasonPhrase()); } | @Override public String getReasonPhrase() { return reason; } | HttpStatus implements StatusType { @Override public String getReasonPhrase() { return reason; } } | HttpStatus implements StatusType { @Override public String getReasonPhrase() { return reason; } HttpStatus(final int statusCode, final String reasonPhrase); } | HttpStatus implements StatusType { @Override public String getReasonPhrase() { return reason; } HttpStatus(final int statusCode, final String reasonPhrase); static boolean isSuccess(int code); static boolean isSuccess(StatusType status); @Override int getStatusCode(); @Override Family getFamily(); @Override String getR... | HttpStatus implements StatusType { @Override public String getReasonPhrase() { return reason; } HttpStatus(final int statusCode, final String reasonPhrase); static boolean isSuccess(int code); static boolean isSuccess(StatusType status); @Override int getStatusCode(); @Override Family getFamily(); @Override String getR... |
@Test public void parseParamFromHeaderValue_normal() { Assert.assertEquals("v", HttpUtils.parseParamFromHeaderValue("xx;k=v", "k")); } | public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { return value.s... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... |
@Test public void parseParamFromHeaderValue_normal_ignoreCase() { Assert.assertEquals("v", HttpUtils.parseParamFromHeaderValue("xx;K=v", "k")); } | public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { return value.s... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... |
@Test public void testDefaultValues() { Assert.assertNull(oGetAllServicesResponse.getServices()); } | public List<Microservice> getServices() { return services; } | GetAllServicesResponse { public List<Microservice> getServices() { return services; } } | GetAllServicesResponse { public List<Microservice> getServices() { return services; } } | GetAllServicesResponse { public List<Microservice> getServices() { return services; } List<Microservice> getServices(); void setServices(List<Microservice> services); } | GetAllServicesResponse { public List<Microservice> getServices() { return services; } List<Microservice> getServices(); void setServices(List<Microservice> services); } |
@Test public void parseParamFromHeaderValue_null() { Assert.assertNull(HttpUtils.parseParamFromHeaderValue(null, "k")); } | public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { return value.s... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... |
@Test public void parseParamFromHeaderValue_noKv() { Assert.assertNull(HttpUtils.parseParamFromHeaderValue("xx", "k")); } | public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { return value.s... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... |
@Test public void parseParamFromHeaderValue_noV() { Assert.assertEquals("", HttpUtils.parseParamFromHeaderValue("xx;k=", "k")); } | public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { return value.s... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... |
@Test public void parseParamFromHeaderValue_keyNotFound() { Assert.assertNull(HttpUtils.parseParamFromHeaderValue("xx;k=", "kk")); } | public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { return value.s... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... | HttpUtils { public static String parseParamFromHeaderValue(String headerValue, String paramName) { if (StringUtils.isEmpty(headerValue)) { return null; } for (String value : headerValue.split(";")) { int idx = value.indexOf('='); if (idx == -1) { continue; } if (paramName.equalsIgnoreCase(value.substring(0, idx))) { re... |
@Test public void uriEncode_null() { Assert.assertEquals("", HttpUtils.uriEncodePath(null)); } | public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } | HttpUtils { public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } } | HttpUtils { public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } private HttpUtils(); } | HttpUtils { public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } private HttpUtils(); static String parseParamFrom... | HttpUtils { public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } private HttpUtils(); static String parseParamFrom... |
@Test public void uriDecode_null() { Assert.assertNull(HttpUtils.uriDecodePath(null)); } | public static String uriDecodePath(String path) { if (path == null) { return null; } try { return new URI(path).getPath(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriDecode failed, path=\"%s\".", path), e); } } | HttpUtils { public static String uriDecodePath(String path) { if (path == null) { return null; } try { return new URI(path).getPath(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriDecode failed, path=\"%s\".", path), e); } } } | HttpUtils { public static String uriDecodePath(String path) { if (path == null) { return null; } try { return new URI(path).getPath(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriDecode failed, path=\"%s\".", path), e); } } private HttpUtils(); } | HttpUtils { public static String uriDecodePath(String path) { if (path == null) { return null; } try { return new URI(path).getPath(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriDecode failed, path=\"%s\".", path), e); } } private HttpUtils(); static String parseParamFromHead... | HttpUtils { public static String uriDecodePath(String path) { if (path == null) { return null; } try { return new URI(path).getPath(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriDecode failed, path=\"%s\".", path), e); } } private HttpUtils(); static String parseParamFromHead... |
@Test public void uriEncode_chineseAndSpace() { String encoded = HttpUtils.uriEncodePath("测 试"); Assert.assertEquals("%E6%B5%8B%20%E8%AF%95", encoded); Assert.assertEquals("测 试", HttpUtils.uriDecodePath(encoded)); } | public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } | HttpUtils { public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } } | HttpUtils { public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } private HttpUtils(); } | HttpUtils { public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } private HttpUtils(); static String parseParamFrom... | HttpUtils { public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } private HttpUtils(); static String parseParamFrom... |
@Test public void uriEncode_failed() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage(Matchers.is("uriEncode failed, path=\":\".")); expectedException.expectCause(Matchers.instanceOf(URISyntaxException.class)); HttpUtils.uriEncodePath(":"); } | public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } | HttpUtils { public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } } | HttpUtils { public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } private HttpUtils(); } | HttpUtils { public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } private HttpUtils(); static String parseParamFrom... | HttpUtils { public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } private HttpUtils(); static String parseParamFrom... |
@Test public void uriEncode_encodeEntirePath() { String encoded = HttpUtils.uriEncodePath("a%%'+b/def"); Assert.assertEquals("a%25%25'+b/def", encoded); } | public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } | HttpUtils { public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } } | HttpUtils { public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } private HttpUtils(); } | HttpUtils { public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } private HttpUtils(); static String parseParamFrom... | HttpUtils { public static String uriEncodePath(String path) { try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); } } private HttpUtils(); static String parseParamFrom... |
@Test public void pathParamEncode() { Assert.assertEquals("a+b", HttpUtils.encodePathParam("a+b")); Assert.assertEquals("a%25b", HttpUtils.encodePathParam("a%b")); Assert.assertEquals("a%25%25b", HttpUtils.encodePathParam("a%%b")); Assert.assertEquals("%3C%20%3E'%22%EF%BC%88)&%2F%20%20", HttpUtils.encodePathParam("< >'... | public static String encodePathParam(String pathParam) { return UrlEscapers.urlPathSegmentEscaper().escape(pathParam); } | HttpUtils { public static String encodePathParam(String pathParam) { return UrlEscapers.urlPathSegmentEscaper().escape(pathParam); } } | HttpUtils { public static String encodePathParam(String pathParam) { return UrlEscapers.urlPathSegmentEscaper().escape(pathParam); } private HttpUtils(); } | HttpUtils { public static String encodePathParam(String pathParam) { return UrlEscapers.urlPathSegmentEscaper().escape(pathParam); } private HttpUtils(); static String parseParamFromHeaderValue(String headerValue, String paramName); static String uriEncodePath(String path); static String encodePathParam(String pathPar... | HttpUtils { public static String encodePathParam(String pathParam) { return UrlEscapers.urlPathSegmentEscaper().escape(pathParam); } private HttpUtils(); static String parseParamFromHeaderValue(String headerValue, String paramName); static String uriEncodePath(String path); static String encodePathParam(String pathPar... |
@Test public void testInitializedValues() { initFields(); List<Microservice> list = oGetAllServicesResponse.getServices(); Assert.assertEquals(oMockMicroservice, list.get(0)); } | public List<Microservice> getServices() { return services; } | GetAllServicesResponse { public List<Microservice> getServices() { return services; } } | GetAllServicesResponse { public List<Microservice> getServices() { return services; } } | GetAllServicesResponse { public List<Microservice> getServices() { return services; } List<Microservice> getServices(); void setServices(List<Microservice> services); } | GetAllServicesResponse { public List<Microservice> getServices() { return services; } List<Microservice> getServices(); void setServices(List<Microservice> services); } |
@Test public void pathParamEncode_SafeChar() { Assert.assertEquals("-._~!$'()*,;&=@:+", HttpUtils.encodePathParam("-._~!$'()*,;&=@:+")); } | public static String encodePathParam(String pathParam) { return UrlEscapers.urlPathSegmentEscaper().escape(pathParam); } | HttpUtils { public static String encodePathParam(String pathParam) { return UrlEscapers.urlPathSegmentEscaper().escape(pathParam); } } | HttpUtils { public static String encodePathParam(String pathParam) { return UrlEscapers.urlPathSegmentEscaper().escape(pathParam); } private HttpUtils(); } | HttpUtils { public static String encodePathParam(String pathParam) { return UrlEscapers.urlPathSegmentEscaper().escape(pathParam); } private HttpUtils(); static String parseParamFromHeaderValue(String headerValue, String paramName); static String uriEncodePath(String path); static String encodePathParam(String pathPar... | HttpUtils { public static String encodePathParam(String pathParam) { return UrlEscapers.urlPathSegmentEscaper().escape(pathParam); } private HttpUtils(); static String parseParamFromHeaderValue(String headerValue, String paramName); static String uriEncodePath(String path); static String encodePathParam(String pathPar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.