From 17e50491946812a528958c8118d1171c32b109de Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Mon, 6 May 2013 10:27:06 +0200 Subject: [PATCH] Fix examples --- .../main/java/io/netty/example/filetransfer/FileServer.java | 3 +-- example/src/main/java/io/netty/example/rxtx/RxtxClient.java | 3 +-- .../example/securechat/SecureChatClientInitializer.java | 3 +-- .../example/securechat/SecureChatServerInitializer.java | 3 +-- .../io/netty/example/telnet/TelnetClientInitializer.java | 3 +-- .../io/netty/example/telnet/TelnetServerPipelineFactory.java | 3 +-- .../netty/testsuite/transport/socket/SocketStartTlsTest.java | 5 ++--- .../testsuite/transport/socket/SocketStringEchoTest.java | 4 ++-- 8 files changed, 10 insertions(+), 17 deletions(-) diff --git a/example/src/main/java/io/netty/example/filetransfer/FileServer.java b/example/src/main/java/io/netty/example/filetransfer/FileServer.java index c71ca587ae..8b4a182722 100644 --- a/example/src/main/java/io/netty/example/filetransfer/FileServer.java +++ b/example/src/main/java/io/netty/example/filetransfer/FileServer.java @@ -16,7 +16,6 @@ package io.netty.example.filetransfer; import io.netty.bootstrap.ServerBootstrap; -import io.netty.buffer.BufType; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundMessageHandlerAdapter; @@ -66,7 +65,7 @@ public class FileServer { @Override public void initChannel(SocketChannel ch) throws Exception { ch.pipeline().addLast( - new StringEncoder(BufType.BYTE, CharsetUtil.UTF_8), + new StringEncoder(CharsetUtil.UTF_8), new LineBasedFrameDecoder(8192), new StringDecoder(CharsetUtil.UTF_8), new FileHandler()); diff --git a/example/src/main/java/io/netty/example/rxtx/RxtxClient.java b/example/src/main/java/io/netty/example/rxtx/RxtxClient.java index 834d723f1a..7737e12a7e 100644 --- a/example/src/main/java/io/netty/example/rxtx/RxtxClient.java +++ b/example/src/main/java/io/netty/example/rxtx/RxtxClient.java @@ -16,7 +16,6 @@ package io.netty.example.rxtx; import io.netty.bootstrap.Bootstrap; -import io.netty.buffer.BufType; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelInitializer; import io.netty.channel.EventLoopGroup; @@ -43,7 +42,7 @@ public final class RxtxClient { public void initChannel(RxtxChannel ch) throws Exception { ch.pipeline().addLast( new LineBasedFrameDecoder(32768), - new StringEncoder(BufType.BYTE), + new StringEncoder(), new StringDecoder(), new RxtxClientHandler() ); diff --git a/example/src/main/java/io/netty/example/securechat/SecureChatClientInitializer.java b/example/src/main/java/io/netty/example/securechat/SecureChatClientInitializer.java index f9d22ea579..413d659c1a 100644 --- a/example/src/main/java/io/netty/example/securechat/SecureChatClientInitializer.java +++ b/example/src/main/java/io/netty/example/securechat/SecureChatClientInitializer.java @@ -15,7 +15,6 @@ */ package io.netty.example.securechat; -import io.netty.buffer.BufType; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.channel.socket.SocketChannel; @@ -52,7 +51,7 @@ public class SecureChatClientInitializer extends ChannelInitializer { private static final StringDecoder DECODER = new StringDecoder(); - private static final StringEncoder ENCODER = new StringEncoder(BufType.BYTE); + private static final StringEncoder ENCODER = new StringEncoder(); private static final TelnetClientHandler CLIENTHANDLER = new TelnetClientHandler(); @Override public void initChannel(SocketChannel ch) throws Exception { diff --git a/example/src/main/java/io/netty/example/telnet/TelnetServerPipelineFactory.java b/example/src/main/java/io/netty/example/telnet/TelnetServerPipelineFactory.java index ed0610344e..70b0195b9b 100644 --- a/example/src/main/java/io/netty/example/telnet/TelnetServerPipelineFactory.java +++ b/example/src/main/java/io/netty/example/telnet/TelnetServerPipelineFactory.java @@ -15,7 +15,6 @@ */ package io.netty.example.telnet; -import io.netty.buffer.BufType; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.channel.socket.SocketChannel; @@ -29,7 +28,7 @@ import io.netty.handler.codec.string.StringEncoder; */ public class TelnetServerPipelineFactory extends ChannelInitializer { private static final StringDecoder DECODER = new StringDecoder(); - private static final StringEncoder ENCODER = new StringEncoder(BufType.BYTE); + private static final StringEncoder ENCODER = new StringEncoder(); private static final TelnetServerHandler SERVERHANDLER = new TelnetServerHandler(); @Override diff --git a/testsuite/src/test/java/io/netty/testsuite/transport/socket/SocketStartTlsTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/SocketStartTlsTest.java index 5a1d6b833d..54b70d15a9 100644 --- a/testsuite/src/test/java/io/netty/testsuite/transport/socket/SocketStartTlsTest.java +++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/SocketStartTlsTest.java @@ -17,7 +17,6 @@ package io.netty.testsuite.transport.socket; import io.netty.bootstrap.Bootstrap; import io.netty.bootstrap.ServerBootstrap; -import io.netty.buffer.BufType; import io.netty.channel.Channel; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundMessageHandlerAdapter; @@ -77,7 +76,7 @@ public class SocketStartTlsTest extends AbstractSocketTest { public void initChannel(SocketChannel sch) throws Exception { ChannelPipeline p = sch.pipeline(); p.addLast("logger", new ByteLoggingHandler(LOG_LEVEL)); - p.addLast(new LineBasedFrameDecoder(64), new StringDecoder(), new StringEncoder(BufType.BYTE)); + p.addLast(new LineBasedFrameDecoder(64), new StringDecoder(), new StringEncoder()); p.addLast(executor, sh); } }); @@ -87,7 +86,7 @@ public class SocketStartTlsTest extends AbstractSocketTest { public void initChannel(SocketChannel sch) throws Exception { ChannelPipeline p = sch.pipeline(); p.addLast("logger", new ByteLoggingHandler(LOG_LEVEL)); - p.addLast(new LineBasedFrameDecoder(64), new StringDecoder(), new StringEncoder(BufType.BYTE)); + p.addLast(new LineBasedFrameDecoder(64), new StringDecoder(), new StringEncoder()); p.addLast(executor, ch); } }); diff --git a/testsuite/src/test/java/io/netty/testsuite/transport/socket/SocketStringEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/SocketStringEchoTest.java index 3488256179..391f567037 100644 --- a/testsuite/src/test/java/io/netty/testsuite/transport/socket/SocketStringEchoTest.java +++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/SocketStringEchoTest.java @@ -67,7 +67,7 @@ public class SocketStringEchoTest extends AbstractSocketTest { public void initChannel(SocketChannel sch) throws Exception { sch.pipeline().addLast("framer", new DelimiterBasedFrameDecoder(512, Delimiters.lineDelimiter())); sch.pipeline().addLast("decoder", new StringDecoder(CharsetUtil.ISO_8859_1)); - sch.pipeline().addBefore("decoder", "encoder", new StringEncoder(BufType.BYTE, CharsetUtil.ISO_8859_1)); + sch.pipeline().addBefore("decoder", "encoder", new StringEncoder(CharsetUtil.ISO_8859_1)); sch.pipeline().addAfter("decoder", "handler", sh); } }); @@ -77,7 +77,7 @@ public class SocketStringEchoTest extends AbstractSocketTest { public void initChannel(SocketChannel sch) throws Exception { sch.pipeline().addLast("framer", new DelimiterBasedFrameDecoder(512, Delimiters.lineDelimiter())); sch.pipeline().addLast("decoder", new StringDecoder(CharsetUtil.ISO_8859_1)); - sch.pipeline().addBefore("decoder", "encoder", new StringEncoder(BufType.BYTE, CharsetUtil.ISO_8859_1)); + sch.pipeline().addBefore("decoder", "encoder", new StringEncoder(CharsetUtil.ISO_8859_1)); sch.pipeline().addAfter("decoder", "handler", ch); } });