From 9aec8119cbf8bd2a185277534aacb9d9fc7e5a65 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Sun, 16 Nov 2008 13:34:24 +0000 Subject: [PATCH] Used logger instead of syserr --- .../netty/handler/ssl/AbstractSocketSslEchoTest.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/jboss/netty/handler/ssl/AbstractSocketSslEchoTest.java b/src/test/java/org/jboss/netty/handler/ssl/AbstractSocketSslEchoTest.java index b4af5497f8..3d3e52216d 100644 --- a/src/test/java/org/jboss/netty/handler/ssl/AbstractSocketSslEchoTest.java +++ b/src/test/java/org/jboss/netty/handler/ssl/AbstractSocketSslEchoTest.java @@ -52,6 +52,8 @@ import org.jboss.netty.channel.SimpleChannelHandler; import org.jboss.netty.example.securechat.SecureChatSslContextFactory; import org.jboss.netty.handler.execution.ExecutionHandler; import org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor; +import org.jboss.netty.logging.InternalLogger; +import org.jboss.netty.logging.InternalLoggerFactory; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -65,6 +67,8 @@ import org.junit.Test; * */ public abstract class AbstractSocketSslEchoTest { + static final InternalLogger logger = + InternalLoggerFactory.getInstance(AbstractSocketSslEchoTest.class); private static final Random random = new Random(); static final byte[] data = new byte[1048576]; @@ -150,8 +154,7 @@ public abstract class AbstractSocketSslEchoTest { ChannelFuture hf = cc.getPipeline().get(SslHandler.class).handshake(cc); hf.awaitUninterruptibly(); if (!hf.isSuccess()) { - System.err.println("Handshake failed:"); - hf.getCause().printStackTrace(); + logger.error("Handshake failed", hf.getCause()); } assertTrue(hf.isSuccess()); @@ -248,8 +251,9 @@ public abstract class AbstractSocketSslEchoTest { @Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { + logger.warn("Unexpected exception", e.getCause()); + exception.compareAndSet(null, e.getCause()); - e.getCause().printStackTrace(); e.getChannel().close(); } }