* Added DummyHandler for testing
* Suppressed unnecessary warning messages
This commit is contained in:
parent
e34d494496
commit
beb0fb0d6f
@ -38,6 +38,7 @@ import org.jboss.netty.channel.ChannelFactory;
|
||||
import org.jboss.netty.channel.ChannelFuture;
|
||||
import org.jboss.netty.channel.ChannelPipelineException;
|
||||
import org.jboss.netty.channel.ChannelPipelineFactory;
|
||||
import org.jboss.netty.util.DummyHandler;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
@ -96,6 +97,8 @@ public abstract class AbstractSocketClientBootstrapTest {
|
||||
|
||||
ClientBootstrap bootstrap =
|
||||
new ClientBootstrap(newClientSocketChannelFactory(executor));
|
||||
|
||||
bootstrap.getPipeline().addLast("dummy", new DummyHandler());
|
||||
bootstrap.setOption(
|
||||
"remoteAddress",
|
||||
new InetSocketAddress(
|
||||
@ -131,6 +134,8 @@ public abstract class AbstractSocketClientBootstrapTest {
|
||||
|
||||
ClientBootstrap bootstrap =
|
||||
new ClientBootstrap(newClientSocketChannelFactory(executor));
|
||||
|
||||
bootstrap.getPipeline().addLast("dummy", new DummyHandler());
|
||||
bootstrap.setOption(
|
||||
"remoteAddress",
|
||||
new InetSocketAddress(
|
||||
|
@ -44,6 +44,7 @@ import org.jboss.netty.channel.ChannelPipelineFactory;
|
||||
import org.jboss.netty.channel.ChildChannelStateEvent;
|
||||
import org.jboss.netty.channel.SimpleChannelHandler;
|
||||
import org.jboss.netty.channel.socket.SocketChannelConfig;
|
||||
import org.jboss.netty.util.DummyHandler;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
@ -199,11 +200,4 @@ public abstract class AbstractSocketServerBootstrapTest {
|
||||
result.append('1');
|
||||
}
|
||||
}
|
||||
|
||||
@ChannelPipelineCoverage("all")
|
||||
private static class DummyHandler extends SimpleChannelHandler {
|
||||
DummyHandler() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ import java.util.concurrent.TimeUnit;
|
||||
import org.jboss.netty.bootstrap.ClientBootstrap;
|
||||
import org.jboss.netty.channel.ChannelFuture;
|
||||
import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
|
||||
import org.jboss.netty.util.DummyHandler;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@ -57,6 +58,7 @@ public class NioClientSocketShutdownTimeTest {
|
||||
ExecutorService e1 = Executors.newCachedThreadPool();
|
||||
ExecutorService e2 = Executors.newCachedThreadPool();
|
||||
ClientBootstrap b = new ClientBootstrap(new NioClientSocketChannelFactory(e1, e2));
|
||||
b.getPipeline().addLast("handler", new DummyHandler());
|
||||
|
||||
try {
|
||||
serverSocket.configureBlocking(false);
|
||||
|
23
src/test/java/org/jboss/netty/util/DummyHandler.java
Normal file
23
src/test/java/org/jboss/netty/util/DummyHandler.java
Normal file
@ -0,0 +1,23 @@
|
||||
package org.jboss.netty.util;
|
||||
|
||||
import org.jboss.netty.channel.ChannelEvent;
|
||||
import org.jboss.netty.channel.ChannelHandlerContext;
|
||||
import org.jboss.netty.channel.ChannelPipelineCoverage;
|
||||
import org.jboss.netty.channel.ChannelUpstreamHandler;
|
||||
|
||||
/**
|
||||
* A dummy handler for a testing purpose.
|
||||
*
|
||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||
* @author Trustin Lee (tlee@redhat.com)
|
||||
*
|
||||
* @version $Rev$, $Date$
|
||||
*/
|
||||
@ChannelPipelineCoverage("all")
|
||||
public class DummyHandler implements ChannelUpstreamHandler {
|
||||
|
||||
public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e)
|
||||
throws Exception {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user