Use logger instead of System.err
This commit is contained in:
parent
6288e02a9a
commit
e3431db547
@ -15,32 +15,32 @@
|
|||||||
*/
|
*/
|
||||||
package io.netty.channel.local;
|
package io.netty.channel.local;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import io.netty.bootstrap.Bootstrap;
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import io.netty.bootstrap.ClientBootstrap;
|
|
||||||
import io.netty.bootstrap.ServerBootstrap;
|
import io.netty.bootstrap.ServerBootstrap;
|
||||||
import io.netty.channel.Channel;
|
|
||||||
import io.netty.channel.Channels;
|
|
||||||
import io.netty.channel.ChannelEvent;
|
|
||||||
import io.netty.channel.ChannelFuture;
|
import io.netty.channel.ChannelFuture;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.ChannelPipeline;
|
import io.netty.channel.ChannelPipeline;
|
||||||
import io.netty.channel.ChannelPipelineFactory;
|
import io.netty.logging.InternalLogger;
|
||||||
import io.netty.channel.SimpleChannelUpstreamHandler;
|
import io.netty.logging.InternalLoggerFactory;
|
||||||
import io.netty.channel.local.DefaultLocalClientChannelFactory;
|
|
||||||
import io.netty.channel.local.DefaultLocalServerChannelFactory;
|
import java.nio.channels.Channels;
|
||||||
import io.netty.channel.local.LocalAddress;
|
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
public class LocalAddressTest {
|
public class LocalAddressTest {
|
||||||
|
|
||||||
|
private static final InternalLogger logger =
|
||||||
|
InternalLoggerFactory.getInstance(LocalAddressTest.class);
|
||||||
|
|
||||||
private static String LOCAL_ADDR_ID = "test.id";
|
private static String LOCAL_ADDR_ID = "test.id";
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void localConnectOK()
|
public void localConnectOK()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
|
|
||||||
ClientBootstrap cb = new ClientBootstrap(new DefaultLocalClientChannelFactory());
|
Bootstrap cb = new Bootstrap();
|
||||||
ServerBootstrap sb = new ServerBootstrap(new DefaultLocalServerChannelFactory());
|
ServerBootstrap sb = new ServerBootstrap();
|
||||||
|
|
||||||
cb.setPipelineFactory(new ChannelPipelineFactory() {
|
cb.setPipelineFactory(new ChannelPipelineFactory() {
|
||||||
@Override
|
@Override
|
||||||
@ -157,7 +157,7 @@ public class LocalAddressTest {
|
|||||||
ChannelEvent e)
|
ChannelEvent e)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
|
|
||||||
System.err.println(String.format("Received upstream event '%s'", e));
|
logger.info(String.format("Received upstream event '%s'", e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user