Skip to content

Commit

Permalink
Fix test failures in ProxyHandlerTest
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
trustin committed Oct 16, 2014
1 parent fa248ce commit 0b0544d
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -36,6 +36,7 @@
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.DefaultExecutorServiceFactory;
import io.netty.util.concurrent.Future;
Expand Down Expand Up @@ -522,6 +523,7 @@ protected void test() throws Exception {
Bootstrap b = new Bootstrap();
b.group(group);
b.channel(NioSocketChannel.class);
b.resolver(NoopNameResolverGroup.INSTANCE);
b.handler(new ChannelInitializer<SocketChannel>() {
@Override
protected void initChannel(SocketChannel ch) throws Exception {
Expand Down Expand Up @@ -569,6 +571,7 @@ protected void test() throws Exception {
Bootstrap b = new Bootstrap();
b.group(group);
b.channel(NioSocketChannel.class);
b.resolver(NoopNameResolverGroup.INSTANCE);
b.handler(new ChannelInitializer<SocketChannel>() {
@Override
protected void initChannel(SocketChannel ch) throws Exception {
Expand Down Expand Up @@ -613,6 +616,7 @@ protected void test() throws Exception {
Bootstrap b = new Bootstrap();
b.group(group);
b.channel(NioSocketChannel.class);
b.resolver(NoopNameResolverGroup.INSTANCE);
b.handler(new ChannelInitializer<SocketChannel>() {
@Override
protected void initChannel(SocketChannel ch) throws Exception {
Expand Down

0 comments on commit 0b0544d

Please sign in to comment.