http://git-wip-us.apache.org/repos/asf/camel/blob/e166efcd/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPMulticastAsyncTest.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPMulticastAsyncTest.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPMulticastAsyncTest.java index 6e8ad60..4d42422 100644 --- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPMulticastAsyncTest.java +++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPMulticastAsyncTest.java @@ -71,7 +71,7 @@ public class NettyUDPMulticastAsyncTest extends BaseNettyTest { mock.message(0).body().startsWith("Song Of A Dream".getBytes()); // any IP in the range of 224.0.0.0 through 239.255.255.255 does the job - sendFile("netty:udp://224.1.2.3:{{port}}?sync=false"); + sendFile("netty4:udp://224.1.2.3:{{port}}?sync=false"); mock.assertIsSatisfied(); } @@ -81,7 +81,7 @@ public class NettyUDPMulticastAsyncTest extends BaseNettyTest { return new RouteBuilder() { @Override public void configure() throws Exception { - from("netty:udp://224.1.2.3:{{port}}?sync=false&networkInterface=en0") + from("netty4:udp://224.1.2.3:{{port}}?sync=false&networkInterface=en0") .to("mock:result") .to("log:Message"); }
http://git-wip-us.apache.org/repos/asf/camel/blob/e166efcd/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPObjectSyncTest.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPObjectSyncTest.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPObjectSyncTest.java index 28c41f3..5d2111d 100644 --- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPObjectSyncTest.java +++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPObjectSyncTest.java @@ -26,7 +26,7 @@ public class NettyUDPObjectSyncTest extends BaseNettyTest { @Test public void testUDPObjectInOutWithNettyConsumer() throws Exception { Poetry poetry = new Poetry(); - Poetry response = template.requestBody("netty:udp://localhost:{{port}}?sync=true", poetry, Poetry.class); + Poetry response = template.requestBody("netty4:udp://localhost:{{port}}?sync=true", poetry, Poetry.class); assertEquals("Dr. Sarojini Naidu", response.getPoet()); } @@ -35,7 +35,7 @@ public class NettyUDPObjectSyncTest extends BaseNettyTest { return new RouteBuilder() { @Override public void configure() throws Exception { - from("netty:udp://localhost:{{port}}?sync=true") + from("netty4:udp://localhost:{{port}}?sync=true") .process(new Processor() { public void process(Exchange exchange) throws Exception { Poetry poetry = (Poetry) exchange.getIn().getBody(); http://git-wip-us.apache.org/repos/asf/camel/blob/e166efcd/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPSyncTest.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPSyncTest.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPSyncTest.java index a8b4407..b9ad248 100644 --- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPSyncTest.java +++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPSyncTest.java @@ -27,7 +27,7 @@ public class NettyUDPSyncTest extends BaseNettyTest { public void testUDPStringInOutWithNettyConsumer() throws Exception { for (int i = 0; i < 5; i++) { String response = template.requestBody( - "netty:udp://localhost:{{port}}?sync=true", + "netty4:udp://localhost:{{port}}?sync=true", "After the Battle of Thermopylae in 480 BC - Simonides of Ceos (c. 556 BC-468 BC), Greek lyric poet wrote ?", String.class); assertEquals("Go tell the Spartans, thou that passest by, That faithful to their precepts here we lie.", response); } @@ -38,7 +38,7 @@ public class NettyUDPSyncTest extends BaseNettyTest { return new RouteBuilder() { @Override public void configure() throws Exception { - from("netty:udp://localhost:{{port}}?sync=true") + from("netty4:udp://localhost:{{port}}?sync=true") .process(new Processor() { public void process(Exchange exchange) throws Exception { exchange.getOut().setBody("Go tell the Spartans, thou that passest by, That faithful to their precepts here we lie."); http://git-wip-us.apache.org/repos/asf/camel/blob/e166efcd/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUdpWithInOutUsingPlainSocketTest.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUdpWithInOutUsingPlainSocketTest.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUdpWithInOutUsingPlainSocketTest.java index 5406069..7fafbd7 100644 --- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUdpWithInOutUsingPlainSocketTest.java +++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUdpWithInOutUsingPlainSocketTest.java @@ -66,7 +66,7 @@ public class NettyUdpWithInOutUsingPlainSocketTest extends BaseNettyTest { protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { - from("netty:udp://127.0.0.1:{{port}}?textline=true&sync=true").process(new Processor() { + from("netty4:udp://127.0.0.1:{{port}}?textline=true&sync=true").process(new Processor() { public void process(Exchange exchange) throws Exception { String s = exchange.getIn().getBody(String.class); LOG.debug("Server got: " + s); http://git-wip-us.apache.org/repos/asf/camel/blob/e166efcd/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUseSharedWorkerThreadPoolManyRoutesTest.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUseSharedWorkerThreadPoolManyRoutesTest.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUseSharedWorkerThreadPoolManyRoutesTest.java index 58ae4c2..c8b2680 100644 --- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUseSharedWorkerThreadPoolManyRoutesTest.java +++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUseSharedWorkerThreadPoolManyRoutesTest.java @@ -70,7 +70,7 @@ public class NettyUseSharedWorkerThreadPoolManyRoutesTest extends BaseNettyTest jndi.bind("sharedBoss", sharedBoosGroup); for (int i = 0; i < 100; i++) { - from("netty:tcp://localhost:" + getNextPort() + "?textline=true&sync=true&orderedThreadPoolExecutor=false" + from("netty4:tcp://localhost:" + getNextPort() + "?textline=true&sync=true&orderedThreadPoolExecutor=false" + "&bossPool=#sharedBoss&workerPool=#sharedWorker") .validate(body().isInstanceOf(String.class)) .to("log:result") http://git-wip-us.apache.org/repos/asf/camel/blob/e166efcd/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUseSharedWorkerThreadPoolTest.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUseSharedWorkerThreadPoolTest.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUseSharedWorkerThreadPoolTest.java index b80dd0d..ccf6fed 100644 --- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUseSharedWorkerThreadPoolTest.java +++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUseSharedWorkerThreadPoolTest.java @@ -49,13 +49,13 @@ public class NettyUseSharedWorkerThreadPoolTest extends BaseNettyTest { getMockEndpoint("mock:result").expectedMessageCount(30); for (int i = 0; i < 10; i++) { - String reply = template.requestBody("netty:tcp://localhost:" + port + "?textline=true&sync=true&workerPool=#sharedClientPool", "Hello World", String.class); + String reply = template.requestBody("netty4:tcp://localhost:" + port + "?textline=true&sync=true&workerPool=#sharedClientPool", "Hello World", String.class); assertEquals("Bye World", reply); - reply = template.requestBody("netty:tcp://localhost:" + port2 + "?textline=true&sync=true&workerPool=#sharedClientPool", "Hello Camel", String.class); + reply = template.requestBody("netty4:tcp://localhost:" + port2 + "?textline=true&sync=true&workerPool=#sharedClientPool", "Hello Camel", String.class); assertEquals("Hi Camel", reply); - reply = template.requestBody("netty:tcp://localhost:" + port3 + "?textline=true&sync=true&workerPool=#sharedClientPool", "Hello Claus", String.class); + reply = template.requestBody("netty4:tcp://localhost:" + port3 + "?textline=true&sync=true&workerPool=#sharedClientPool", "Hello Claus", String.class); assertEquals("Hej Claus", reply); } @@ -80,19 +80,19 @@ public class NettyUseSharedWorkerThreadPoolTest extends BaseNettyTest { port2 = getNextPort(); port3 = getNextPort(); - from("netty:tcp://localhost:" + port + "?textline=true&sync=true&workerPool=#sharedServerPool&orderedThreadPoolExecutor=false") + from("netty4:tcp://localhost:" + port + "?textline=true&sync=true&workerPool=#sharedServerPool&orderedThreadPoolExecutor=false") .validate(body().isInstanceOf(String.class)) .to("log:result") .to("mock:result") .transform(body().regexReplaceAll("Hello", "Bye")); - from("netty:tcp://localhost:" + port2 + "?textline=true&sync=true&workerPool=#sharedServerPool&orderedThreadPoolExecutor=false") + from("netty4:tcp://localhost:" + port2 + "?textline=true&sync=true&workerPool=#sharedServerPool&orderedThreadPoolExecutor=false") .validate(body().isInstanceOf(String.class)) .to("log:result") .to("mock:result") .transform(body().regexReplaceAll("Hello", "Hi")); - from("netty:tcp://localhost:" + port3 + "?textline=true&sync=true&workerPool=#sharedServerPool&orderedThreadPoolExecutor=false") + from("netty4:tcp://localhost:" + port3 + "?textline=true&sync=true&workerPool=#sharedServerPool&orderedThreadPoolExecutor=false") .validate(body().isInstanceOf(String.class)) .to("log:result") .to("mock:result") http://git-wip-us.apache.org/repos/asf/camel/blob/e166efcd/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/SpringNettyUseSharedWorkerThreadPoolTest.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/SpringNettyUseSharedWorkerThreadPoolTest.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/SpringNettyUseSharedWorkerThreadPoolTest.java index ef0b231..2a4254a 100644 --- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/SpringNettyUseSharedWorkerThreadPoolTest.java +++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/SpringNettyUseSharedWorkerThreadPoolTest.java @@ -31,13 +31,13 @@ public class SpringNettyUseSharedWorkerThreadPoolTest extends CamelSpringTestSup getMockEndpoint("mock:result").expectedMessageCount(30); for (int i = 0; i < 10; i++) { - String reply = template.requestBody("netty:tcp://localhost:5021?textline=true&sync=true", "Hello World", String.class); + String reply = template.requestBody("netty4:tcp://localhost:5021?textline=true&sync=true", "Hello World", String.class); assertEquals("Hello World", reply); - reply = template.requestBody("netty:tcp://localhost:5022?textline=true&sync=true", "Hello Camel", String.class); + reply = template.requestBody("netty4:tcp://localhost:5022?textline=true&sync=true", "Hello Camel", String.class); assertEquals("Hello Camel", reply); - reply = template.requestBody("netty:tcp://localhost:5023?textline=true&sync=true", "Hello Claus", String.class); + reply = template.requestBody("netty4:tcp://localhost:5023?textline=true&sync=true", "Hello Claus", String.class); assertEquals("Hello Claus", reply); } http://git-wip-us.apache.org/repos/asf/camel/blob/e166efcd/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/UnsharableCodecsConflicts2Test.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/UnsharableCodecsConflicts2Test.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/UnsharableCodecsConflicts2Test.java index b74d703..15fa6c8 100644 --- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/UnsharableCodecsConflicts2Test.java +++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/UnsharableCodecsConflicts2Test.java @@ -85,7 +85,7 @@ public class UnsharableCodecsConflicts2Test extends BaseNettyTest { public void configure() throws Exception { port = getPort(); - from("netty:tcp://localhost:{{port}}?decoder=#length-decoder&sync=false") + from("netty4:tcp://localhost:{{port}}?decoder=#length-decoder&sync=false") .process(processor) .to("mock:result"); } http://git-wip-us.apache.org/repos/asf/camel/blob/e166efcd/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/UnsharableCodecsConflictsTest.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/UnsharableCodecsConflictsTest.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/UnsharableCodecsConflictsTest.java index 715a698..f054cac 100644 --- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/UnsharableCodecsConflictsTest.java +++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/UnsharableCodecsConflictsTest.java @@ -89,10 +89,10 @@ public class UnsharableCodecsConflictsTest extends BaseNettyTest { port1 = getPort(); port2 = getNextPort(); - from("netty:tcp://localhost:" + port1 + "?decoder=#length-decoder&sync=false") + from("netty4:tcp://localhost:" + port1 + "?decoder=#length-decoder&sync=false") .process(processor); - from("netty:tcp://localhost:" + port2 + "?decoder=#length-decoder2&sync=false") + from("netty4:tcp://localhost:" + port2 + "?decoder=#length-decoder2&sync=false") .process(processor) .to("mock:result"); } http://git-wip-us.apache.org/repos/asf/camel/blob/e166efcd/components/camel-netty4/src/test/resources/log4j.properties ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/test/resources/log4j.properties b/components/camel-netty4/src/test/resources/log4j.properties index 35d1b54..fed9ec9 100644 --- a/components/camel-netty4/src/test/resources/log4j.properties +++ b/components/camel-netty4/src/test/resources/log4j.properties @@ -35,4 +35,4 @@ log4j.appender.out.layout.ConversionPattern=%d [%-35.35t] %-5p %-30.30c{1} - %m% log4j.appender.file=org.apache.log4j.FileAppender log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n -log4j.appender.file.file=target/camel-netty-test.log +log4j.appender.file.file=target/camel-netty4-test.log http://git-wip-us.apache.org/repos/asf/camel/blob/e166efcd/components/camel-netty4/src/test/resources/org/apache/camel/component/netty4/SpringNettyUseSharedWorkerThreadPoolTest.xml ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/test/resources/org/apache/camel/component/netty4/SpringNettyUseSharedWorkerThreadPoolTest.xml b/components/camel-netty4/src/test/resources/org/apache/camel/component/netty4/SpringNettyUseSharedWorkerThreadPoolTest.xml index 7ea4d2d..8393265 100644 --- a/components/camel-netty4/src/test/resources/org/apache/camel/component/netty4/SpringNettyUseSharedWorkerThreadPoolTest.xml +++ b/components/camel-netty4/src/test/resources/org/apache/camel/component/netty4/SpringNettyUseSharedWorkerThreadPoolTest.xml @@ -20,24 +20,24 @@ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> <!-- use the worker pool builder to create to help create the shared thread pool --> - <bean id="poolBuilder" class="org.apache.camel.component.netty.NettyWorkerPoolBuilder"> + <bean id="poolBuilder" class="org.apache.camel.component.netty4.NettyWorkerPoolBuilder"> <property name="workerCount" value="2"/> </bean> <!-- the shared worker thread pool --> - <bean id="sharedPool" class="org.jboss.netty.channel.socket.nio.WorkerPool" - factory-bean="poolBuilder" factory-method="build" destroy-method="shutdown"> + <bean id="sharedPool" class="io.netty.channel.EventLoopGroup" + factory-bean="poolBuilder" factory-method="build" destroy-method="shutdownGracefully"> </bean> <camelContext xmlns="http://camel.apache.org/schema/spring"> <route> - <from uri="netty:tcp://localhost:5021?textline=true&sync=true&workerPool=#sharedPool&orderedThreadPoolExecutor=false"/> + <from uri="netty4:tcp://localhost:5021?textline=true&sync=true&workerGroup=#sharedPool&orderedThreadPoolExecutor=false"/> <to uri="log:result"/> <to uri="mock:result"/> </route> <route> - <from uri="netty:tcp://localhost:5022?textline=true&sync=true&workerPool=#sharedPool&orderedThreadPoolExecutor=false"/> + <from uri="netty4:tcp://localhost:5022?textline=true&sync=true&workerGroup=#sharedPool&orderedThreadPoolExecutor=false"/> <to uri="log:result"/> <to uri="mock:result"/> </route> http://git-wip-us.apache.org/repos/asf/camel/blob/e166efcd/components/camel-netty4/src/test/resources/org/apache/camel/component/netty4/multiple-codecs.xml ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/test/resources/org/apache/camel/component/netty4/multiple-codecs.xml b/components/camel-netty4/src/test/resources/org/apache/camel/component/netty4/multiple-codecs.xml index e895577..d9b2271 100644 --- a/components/camel-netty4/src/test/resources/org/apache/camel/component/netty4/multiple-codecs.xml +++ b/components/camel-netty4/src/test/resources/org/apache/camel/component/netty4/multiple-codecs.xml @@ -26,10 +26,10 @@ <camelContext id="multiple-netty-codecs-context" xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="direct:multiple-codec"/> - <to uri="netty:tcp://localhost:5150?encoders=#encoders&sync=false"/> + <to uri="netty4:tcp://localhost:5150?encoders=#encoders&sync=false"/> </route> <route> - <from uri="netty:tcp://localhost:5150?decoders=#length-decoder,#string-decoder&sync=false"/> + <from uri="netty4:tcp://localhost:5150?decoders=#length-decoder,#string-decoder&sync=false"/> <to uri="mock:multiple-codec"/> </route> </camelContext> @@ -37,36 +37,36 @@ <!-- START SNIPPET: registry-beans --> <util:list id="decoders" list-class="java.util.LinkedList"> - <bean class="org.apache.camel.component.netty.ChannelHandlerFactories" factory-method="newLengthFieldBasedFrameDecoder"> + <bean class="org.apache.camel.component.netty4.ChannelHandlerFactories" factory-method="newLengthFieldBasedFrameDecoder"> <constructor-arg value="1048576"/> <constructor-arg value="0"/> <constructor-arg value="4"/> <constructor-arg value="0"/> <constructor-arg value="4"/> </bean> - <bean class="org.jboss.netty.handler.codec.string.StringDecoder"/> + <bean class="io.netty.handler.codec.string.StringDecoder"/> </util:list> <util:list id="encoders" list-class="java.util.LinkedList"> - <bean class="org.jboss.netty.handler.codec.frame.LengthFieldPrepender"> + <bean class="io.netty.handler.codec.LengthFieldPrepender"> <constructor-arg value="4"/> </bean> - <bean class="org.jboss.netty.handler.codec.string.StringEncoder"/> + <bean class="io.netty.handler.codec.string.StringEncoder"/> </util:list> - <bean id="length-encoder" class="org.jboss.netty.handler.codec.frame.LengthFieldPrepender"> + <bean id="length-encoder" class="io.netty.handler.codec.LengthFieldPrepender"> <constructor-arg value="4"/> </bean> - <bean id="string-encoder" class="org.jboss.netty.handler.codec.string.StringEncoder"/> + <bean id="string-encoder" class="io.netty.handler.codec.string.StringEncoder"/> - <bean id="length-decoder" class="org.apache.camel.component.netty.ChannelHandlerFactories" factory-method="newLengthFieldBasedFrameDecoder"> + <bean id="length-decoder" class="org.apache.camel.component.netty4.ChannelHandlerFactories" factory-method="newLengthFieldBasedFrameDecoder"> <constructor-arg value="1048576"/> <constructor-arg value="0"/> <constructor-arg value="4"/> <constructor-arg value="0"/> <constructor-arg value="4"/> </bean> - <bean id="string-decoder" class="org.jboss.netty.handler.codec.string.StringDecoder"/> + <bean id="string-decoder" class="io.netty.handler.codec.string.StringDecoder"/> <!-- START SNIPPET: registry-beans --> </beans>