diff --git a/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketServerBootstrapTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketServerBootstrapTest.java index b4b8afd77d..74ba4e96e3 100644 --- a/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketServerBootstrapTest.java +++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketServerBootstrapTest.java @@ -16,6 +16,17 @@ package io.netty.testsuite.transport.socket; import static org.junit.Assert.*; +import io.netty.bootstrap.ServerBootstrap; +import io.netty.channel.Channel; +import io.netty.channel.ChannelException; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelPipelineException; +import io.netty.channel.socket.SocketChannelConfig; +import io.netty.logging.InternalLogger; +import io.netty.logging.InternalLoggerFactory; +import io.netty.testsuite.util.DummyHandler; +import io.netty.util.SocketAddresses; +import io.netty.util.internal.ExecutorUtil; import java.io.IOException; import java.net.InetSocketAddress; @@ -25,22 +36,6 @@ import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import io.netty.bootstrap.ClientBootstrap; -import io.netty.bootstrap.ServerBootstrap; -import io.netty.channel.Channel; -import io.netty.channel.ChannelException; -import io.netty.channel.ChannelFactory; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelPipelineException; -import io.netty.channel.ChannelPipelineFactory; -import io.netty.channel.ChildChannelStateEvent; -import io.netty.channel.ServerChannelFactory; -import io.netty.channel.SimpleChannelUpstreamHandler; -import io.netty.channel.socket.SocketChannelConfig; -import io.netty.testsuite.util.DummyHandler; -import io.netty.util.SocketAddresses; -import io.netty.util.internal.ExecutorUtil; - import org.easymock.EasyMock; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -52,6 +47,9 @@ import org.junit.Test; */ public abstract class AbstractSocketServerBootstrapTest { + private static final InternalLogger logger = + InternalLoggerFactory.getInstance(AbstractSocketServerBootstrapTest.class); + private static final boolean BUFSIZE_MODIFIABLE; static { @@ -66,12 +64,12 @@ public abstract class AbstractSocketServerBootstrapTest { } } catch (Exception e) { bufSizeModifiable = false; - System.err.println( + logger.warn( "Socket.getReceiveBufferSize() does not work: " + e); } } catch (Exception e) { bufSizeModifiable = false; - System.err.println( + logger.warn( "Socket.setReceiveBufferSize() does not work: " + e); } finally { BUFSIZE_MODIFIABLE = bufSizeModifiable; diff --git a/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketSslEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketSslEchoTest.java index 7134ef5610..6eb891ed0f 100644 --- a/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketSslEchoTest.java +++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketSslEchoTest.java @@ -16,6 +16,17 @@ package io.netty.testsuite.transport.socket; import static org.junit.Assert.*; +import io.netty.bootstrap.ServerBootstrap; +import io.netty.buffer.ChannelBuffer; +import io.netty.buffer.ChannelBuffers; +import io.netty.channel.Channel; +import io.netty.channel.ChannelFuture; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.ssl.SslHandler; +import io.netty.logging.InternalLogger; +import io.netty.logging.InternalLoggerFactory; +import io.netty.util.SocketAddresses; +import io.netty.util.internal.ExecutorUtil; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -41,25 +52,6 @@ import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactorySpi; import javax.net.ssl.X509TrustManager; -import io.netty.bootstrap.ClientBootstrap; -import io.netty.bootstrap.ServerBootstrap; -import io.netty.buffer.ChannelBuffer; -import io.netty.buffer.ChannelBuffers; -import io.netty.channel.Channel; -import io.netty.channel.ChannelFactory; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelStateEvent; -import io.netty.channel.ExceptionEvent; -import io.netty.channel.MessageEvent; -import io.netty.channel.SimpleChannelUpstreamHandler; -import io.netty.handler.execution.ExecutionHandler; -import io.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor; -import io.netty.handler.ssl.SslHandler; -import io.netty.logging.InternalLogger; -import io.netty.logging.InternalLoggerFactory; -import io.netty.util.SocketAddresses; -import io.netty.util.internal.ExecutorUtil; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -318,21 +310,13 @@ public abstract class AbstractSocketSslEchoTest { @Override public void checkClientTrusted( X509Certificate[] chain, String authType) throws CertificateException { - // Always trust - it is an example. - // You should do something in the real world. - // You will reach here only if you enabled client certificate auth, - // as described in SecureChatSslContextFactory. - System.err.println( - "UNKNOWN CLIENT CERTIFICATE: " + chain[0].getSubjectDN()); + // NOOP } @Override public void checkServerTrusted( X509Certificate[] chain, String authType) throws CertificateException { - // Always trust - it is an example. - // You should do something in the real world. - System.err.println( - "UNKNOWN SERVER CERTIFICATE: " + chain[0].getSubjectDN()); + // NOOP } };