GeezerVison is showing github.com — Port: Use random generated LocalAddress in tests that use local trans… · netty/netty@0a25229
File treeExpand file treeCollapse file tree Open diff view settings codec-haproxy/src/test/java/io/netty/handler/codec/haproxy handler-proxy/src/test/java/io/netty/handler/proxy handler/src/test/java/io/netty/handler testsuite/src/main/java/io/netty/testsuite/transport transport/src/test/java/io/netty
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: codec-haproxy/src/test/java/io/netty/handler/codec/haproxy/HAProxyIntegrationTest.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -42,7 +42,7 @@ public class HAProxyIntegrationTest { | 42 | 42 | public void testBasicCase() throws Exception { | 43 | 43 | final CountDownLatch latch = new CountDownLatch(1); | 44 | 44 | final AtomicReference<HAProxyMessage> msgHolder = new AtomicReference<HAProxyMessage>(); | 45 | | - LocalAddress localAddress = new LocalAddress("HAProxyIntegrationTest"); | | 45 | + LocalAddress localAddress = new LocalAddress(HAProxyIntegrationTest.class); | 46 | 46 |
| 47 | 47 | EventLoopGroup group = new DefaultEventLoopGroup(); | 48 | 48 | ServerBootstrap sb = new ServerBootstrap(); | |
Collapse file Copy file name to clipboardExpand all lines: handler-proxy/src/test/java/io/netty/handler/proxy/HttpProxyHandlerTest.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -208,7 +208,7 @@ public void testExceptionDuringConnect() throws Exception { | 208 | 208 | Channel clientChannel = null; | 209 | 209 | try { | 210 | 210 | group = new DefaultEventLoopGroup(1); | 211 | | - final LocalAddress addr = new LocalAddress("a"); | | 211 | + final LocalAddress addr = new LocalAddress(HttpProxyHandlerTest.class); | 212 | 212 | final AtomicReference<Throwable> exception = new AtomicReference<Throwable>(); | 213 | 213 | ChannelFuture sf = | 214 | 214 | new ServerBootstrap().channel(LocalServerChannel.class).group(group).childHandler( | |
Collapse file Copy file name to clipboardExpand all lines: handler/src/test/java/io/netty/handler/ssl/OpenSslCertificateCompressionTest.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -319,7 +319,7 @@ public void runCertCompressionTest(SslContext clientSslContext, SslContext serve | 319 | 319 | ServerBootstrap sb = new ServerBootstrap(); | 320 | 320 | sb.group(group).channel(LocalServerChannel.class) | 321 | 321 | .childHandler(new CertCompressionTestChannelInitializer(serverPromise, serverSslContext)); | 322 | | - Channel serverChannel = sb.bind(new LocalAddress("testCertificateCompression")) | | 322 | + Channel serverChannel = sb.bind(new LocalAddress(OpenSslCertificateCompressionTest.class)) | 323 | 323 | .syncUninterruptibly().channel(); | 324 | 324 |
| 325 | 325 | Bootstrap bootstrap = new Bootstrap(); | |
Collapse file Copy file name to clipboardExpand all lines: handler/src/test/java/io/netty/handler/ssl/SniClientJava8TestUtil.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -85,7 +85,7 @@ static void testSniClient(SslProvider sslClientProvider, SslProvider sslServerPr | 85 | 85 | throws Exception { | 86 | 86 | final String sniHost = "sni.netty.io"; | 87 | 87 | SelfSignedCertificate cert = CachedSelfSignedCertificate.getCachedCertificate(); | 88 | | - LocalAddress address = new LocalAddress("test"); | | 88 | + LocalAddress address = new LocalAddress(SniClientJava8TestUtil.class); | 89 | 89 | EventLoopGroup group = new DefaultEventLoopGroup(1); | 90 | 90 | SslContext sslServerContext = null; | 91 | 91 | SslContext sslClientContext = null; | |
Collapse file Copy file name to clipboardExpand all lines: handler/src/test/java/io/netty/handler/ssl/SniClientTest.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -98,7 +98,7 @@ public void execute() throws Throwable { | 98 | 98 | @MethodSource("parameters") | 99 | 99 | public void testSniClient(SslProvider sslServerProvider, SslProvider sslClientProvider) throws Exception { | 100 | 100 | String sniHostName = "sni.netty.io"; | 101 | | - LocalAddress address = new LocalAddress("SniClientTest"); | | 101 | + LocalAddress address = new LocalAddress(SniClientTest.class); | 102 | 102 | EventLoopGroup group = new DefaultEventLoopGroup(1); | 103 | 103 | SelfSignedCertificate cert = CachedSelfSignedCertificate.getCachedCertificate(); | 104 | 104 | SslContext sslServerContext = null; | |
Collapse file Copy file name to clipboardExpand all lines: handler/src/test/java/io/netty/handler/ssl/SniHandlerTest.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -583,7 +583,7 @@ public void testReplaceHandler(SslProvider provider) throws Exception { | 583 | 583 | case OPENSSL: | 584 | 584 | case OPENSSL_REFCNT: | 585 | 585 | final String sniHost = "sni.netty.io"; | 586 | | - LocalAddress address = new LocalAddress("testReplaceHandler-" + Math.random()); | | 586 | + LocalAddress address = new LocalAddress(SniHandlerTest.class); | 587 | 587 | EventLoopGroup group = new DefaultEventLoopGroup(1); | 588 | 588 | Channel sc = null; | 589 | 589 | Channel cc = null; | |
Collapse file Copy file name to clipboardExpand all lines: handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -654,7 +654,7 @@ public void channelActive(ChannelHandlerContext ctx) { | 654 | 654 | } | 655 | 655 | }); | 656 | 656 |
| 657 | | - serverChannel = sb.bind(new LocalAddress("SslHandlerTest")).sync().channel(); | | 657 | + serverChannel = sb.bind(new LocalAddress(SslHandlerTest.class)).sync().channel(); | 658 | 658 | clientChannel = cb.connect(serverChannel.localAddress()).sync().channel(); | 659 | 659 | latch.await(); | 660 | 660 |
| |
Collapse file Copy file name to clipboardExpand all lines: handler/src/test/java/io/netty/handler/ssl/ocsp/OcspTest.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -369,7 +369,7 @@ private static void handshake(SslProvider sslProvider, CountDownLatch latch, Cha | 369 | 369 | try { | 370 | 370 | EventLoopGroup group = new DefaultEventLoopGroup(); | 371 | 371 | try { | 372 | | - LocalAddress address = new LocalAddress("handshake-" + Math.random()); | | 372 | + LocalAddress address = new LocalAddress(OcspTest.class); | 373 | 373 | Channel server = newServer(group, address, serverSslContext, response, serverHandler); | 374 | 374 | Channel client = newClient(group, address, clientSslContext, callback, clientHandler); | 375 | 375 | try { | |
Collapse file Copy file name to clipboardExpand all lines: handler/src/test/java/io/netty/handler/traffic/TrafficShapingHandlerTest.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -137,7 +137,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception | 137 | 137 | }); | 138 | 138 | } | 139 | 139 | }); | 140 | | - final LocalAddress svrAddr = new LocalAddress("foo"); | | 140 | + final LocalAddress svrAddr = new LocalAddress(TrafficShapingHandlerTest.class); | 141 | 141 | svrChannel = serverBootstrap.bind(svrAddr).sync().channel(); | 142 | 142 | Bootstrap bootstrap = new Bootstrap(); | 143 | 143 | bootstrap.channel(LocalChannel.class).group(GROUP).handler(new ChannelInitializer<Channel>() { | |
Collapse file Copy file name to clipboardExpand all lines: testsuite/src/main/java/io/netty/testsuite/transport/AbstractSingleThreadEventLoopTest.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -131,7 +131,7 @@ public void testShutdownGracefullyNoQuietPeriod() throws Exception { | 131 | 131 |
| 132 | 132 | // Not close the Channel to ensure the EventLoop is still shutdown in time. | 133 | 133 | ChannelFuture cf = serverChannelClass() == LocalServerChannel.class | 134 | | - ? b.bind(new LocalAddress("local")) : b.bind(0); | | 134 | + ? b.bind(new LocalAddress(AbstractSingleThreadEventLoopTest.class)) : b.bind(0); | 135 | 135 | cf.sync().channel(); | 136 | 136 |
| 137 | 137 | Future<?> f = loop.shutdownGracefully(0, 1, TimeUnit.MINUTES); | |
|