From b9eb8f0e01f96e957eef8f57a1e865aa08744c86 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Tue, 14 Oct 2014 18:18:47 +0900 Subject: [PATCH] Fix test failures in ProxyHandlerTest Motivation: The default name resolver attempts to resolve the bad host name (destination.com) and actually succeeds, making the ProxyHandlerTest fail. Modification: Use NoopNameResolverGroup instead. Result: ProxyHandlerTest passes again. --- .../test/java/io/netty/handler/proxy/ProxyHandlerTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/handler-proxy/src/test/java/io/netty/handler/proxy/ProxyHandlerTest.java b/handler-proxy/src/test/java/io/netty/handler/proxy/ProxyHandlerTest.java index ceefa69f16..b71130c5d0 100644 --- a/handler-proxy/src/test/java/io/netty/handler/proxy/ProxyHandlerTest.java +++ b/handler-proxy/src/test/java/io/netty/handler/proxy/ProxyHandlerTest.java @@ -36,6 +36,7 @@ import io.netty.handler.codec.LineBasedFrameDecoder; import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.util.InsecureTrustManagerFactory; import io.netty.handler.ssl.util.SelfSignedCertificate; +import io.netty.resolver.NoopNameResolverGroup; import io.netty.util.CharsetUtil; import io.netty.util.concurrent.DefaultThreadFactory; import io.netty.util.concurrent.Future; @@ -522,6 +523,7 @@ public class ProxyHandlerTest { Bootstrap b = new Bootstrap(); b.group(group); b.channel(NioSocketChannel.class); + b.resolver(NoopNameResolverGroup.INSTANCE); b.handler(new ChannelInitializer() { @Override protected void initChannel(SocketChannel ch) throws Exception { @@ -569,6 +571,7 @@ public class ProxyHandlerTest { Bootstrap b = new Bootstrap(); b.group(group); b.channel(NioSocketChannel.class); + b.resolver(NoopNameResolverGroup.INSTANCE); b.handler(new ChannelInitializer() { @Override protected void initChannel(SocketChannel ch) throws Exception { @@ -613,6 +616,7 @@ public class ProxyHandlerTest { Bootstrap b = new Bootstrap(); b.group(group); b.channel(NioSocketChannel.class); + b.resolver(NoopNameResolverGroup.INSTANCE); b.handler(new ChannelInitializer() { @Override protected void initChannel(SocketChannel ch) throws Exception {