You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2016/11/15 10:58:27 UTC
camel git commit: Clean up the camel-netty4, to speed up the tests
Repository: camel
Updated Branches:
refs/heads/master ced3b4b7f -> bed325e1f
Clean up the camel-netty4, to speed up the tests
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/bed325e1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/bed325e1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/bed325e1
Branch: refs/heads/master
Commit: bed325e1ffa9ecf08ed62c78cb51980fbcb7e3bb
Parents: ced3b4b
Author: Willem Jiang <wi...@gmail.com>
Authored: Tue Nov 15 18:57:44 2016 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Tue Nov 15 18:57:44 2016 +0800
----------------------------------------------------------------------
.../component/netty4/MultipleCodecsSpringTest.java | 1 -
.../netty4/NettyConsumerClientModeReconnectTest.java | 4 ++--
.../camel/component/netty4/NettyRequestTimeoutTest.java | 12 ++++++------
.../component/netty4/NettyUDPByteArrayProviderTest.java | 2 +-
.../component/netty4/NettyUdpConnectedSendTest.java | 2 +-
.../NettyUseSharedWorkerThreadPoolManyRoutesTest.java | 4 ++--
6 files changed, 12 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/bed325e1/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/MultipleCodecsSpringTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/MultipleCodecsSpringTest.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/MultipleCodecsSpringTest.java
index f2a89e4..aaab59d 100644
--- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/MultipleCodecsSpringTest.java
+++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/MultipleCodecsSpringTest.java
@@ -37,7 +37,6 @@ public class MultipleCodecsSpringTest extends CamelSpringTestSupport {
MockEndpoint mock = getMockEndpoint("mock:multiple-codec");
mock.expectedBodiesReceived(poem);
sendBody("direct:multiple-codec", poem);
- mock.await(1, TimeUnit.SECONDS);
mock.assertIsSatisfied();
}
}
http://git-wip-us.apache.org/repos/asf/camel/blob/bed325e1/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyConsumerClientModeReconnectTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyConsumerClientModeReconnectTest.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyConsumerClientModeReconnectTest.java
index c09ca6d..3a4ea97 100644
--- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyConsumerClientModeReconnectTest.java
+++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyConsumerClientModeReconnectTest.java
@@ -61,7 +61,7 @@ public class NettyConsumerClientModeReconnectTest extends BaseNettyTest {
log.info(">>> starting Camel route while Netty server is not ready");
context.startRoute("client");
- Thread.sleep(5000);
+ Thread.sleep(500);
log.info(">>> starting Netty server");
startNettyServer();
@@ -81,7 +81,7 @@ public class NettyConsumerClientModeReconnectTest extends BaseNettyTest {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
- from("netty4:tcp://localhost:{{port}}?textline=true&clientMode=true&reconnect=true&reconnectInterval=2000").id("client")
+ from("netty4:tcp://localhost:{{port}}?textline=true&clientMode=true&reconnect=true&reconnectInterval=200").id("client")
.process(new Processor() {
public void process(final Exchange exchange) {
log.info("Processing exchange in Netty server {}", exchange);
http://git-wip-us.apache.org/repos/asf/camel/blob/bed325e1/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyRequestTimeoutTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyRequestTimeoutTest.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyRequestTimeoutTest.java
index 770fab5..d9fd83d 100644
--- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyRequestTimeoutTest.java
+++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyRequestTimeoutTest.java
@@ -30,14 +30,14 @@ public class NettyRequestTimeoutTest extends BaseNettyTest {
@Test
public void testRequestTimeoutOK() throws Exception {
- String out = template.requestBody("netty4:tcp://localhost:{{port}}?textline=true&sync=true&requestTimeout=5000", "Hello Camel", String.class);
+ String out = template.requestBody("netty4:tcp://localhost:{{port}}?textline=true&sync=true&requestTimeout=500", "Hello Camel", String.class);
assertEquals("Bye World", out);
}
@Test
public void testRequestTimeout() throws Exception {
try {
- template.requestBody("netty4:tcp://localhost:{{port}}?textline=true&sync=true&requestTimeout=1000", "Hello Camel", String.class);
+ template.requestBody("netty4:tcp://localhost:{{port}}?textline=true&sync=true&requestTimeout=100", "Hello Camel", String.class);
fail("Should have thrown exception");
} catch (CamelExecutionException e) {
ReadTimeoutException cause = assertIsInstanceOf(ReadTimeoutException.class, e.getCause());
@@ -48,7 +48,7 @@ public class NettyRequestTimeoutTest extends BaseNettyTest {
@Test
public void testRequestTimeoutViaHeader() throws Exception {
try {
- template.requestBodyAndHeader("netty4:tcp://localhost:{{port}}?textline=true&sync=true", "Hello Camel", NettyConstants.NETTY_REQUEST_TIMEOUT, 1000, String.class);
+ template.requestBodyAndHeader("netty4:tcp://localhost:{{port}}?textline=true&sync=true", "Hello Camel", NettyConstants.NETTY_REQUEST_TIMEOUT, 100, String.class);
fail("Should have thrown exception");
} catch (CamelExecutionException e) {
ReadTimeoutException cause = assertIsInstanceOf(ReadTimeoutException.class, e.getCause());
@@ -59,7 +59,7 @@ public class NettyRequestTimeoutTest extends BaseNettyTest {
@Test
public void testRequestTimeoutAndOk() throws Exception {
try {
- template.requestBody("netty4:tcp://localhost:{{port}}?textline=true&sync=true&requestTimeout=1000", "Hello Camel", String.class);
+ template.requestBody("netty4:tcp://localhost:{{port}}?textline=true&sync=true&requestTimeout=100", "Hello Camel", String.class);
fail("Should have thrown exception");
} catch (CamelExecutionException e) {
ReadTimeoutException cause = assertIsInstanceOf(ReadTimeoutException.class, e.getCause());
@@ -67,7 +67,7 @@ public class NettyRequestTimeoutTest extends BaseNettyTest {
}
// now we try again but this time the is no delay on server and thus faster
- String out = template.requestBody("netty4:tcp://localhost:{{port}}?textline=true&sync=true&requestTimeout=1000", "Hello World", String.class);
+ String out = template.requestBody("netty4:tcp://localhost:{{port}}?textline=true&sync=true&requestTimeout=100", "Hello World", String.class);
assertEquals("Bye World", out);
}
@@ -83,7 +83,7 @@ public class NettyRequestTimeoutTest extends BaseNettyTest {
String body = exchange.getIn().getBody(String.class);
if (body.contains("Camel")) {
- Thread.sleep(3000);
+ Thread.sleep(200);
}
}
})
http://git-wip-us.apache.org/repos/asf/camel/blob/bed325e1/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPByteArrayProviderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPByteArrayProviderTest.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPByteArrayProviderTest.java
index ff6c7cc..783d641 100644
--- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPByteArrayProviderTest.java
+++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUDPByteArrayProviderTest.java
@@ -36,7 +36,7 @@ import org.junit.Test;
public class NettyUDPByteArrayProviderTest extends BaseNettyTest {
private static final String SEND_STRING = "ef3e00559f5faf0262f5ff0962d9008daa91001cd46b0fa9330ef0f3030fff250e46f72444d1cc501678c351e04b8004c"
+ "4000002080000fe850bbe011030000008031b031bfe9251305441593830354720020800050440ff";
- private static final int SEND_COUNT = 20;
+ private static final int SEND_COUNT = 10;
private volatile int receivedCount;
private EventLoopGroup group;
private Bootstrap bootstrap;
http://git-wip-us.apache.org/repos/asf/camel/blob/bed325e1/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUdpConnectedSendTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUdpConnectedSendTest.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUdpConnectedSendTest.java
index 29e9c7a..d48cf05 100644
--- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUdpConnectedSendTest.java
+++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUdpConnectedSendTest.java
@@ -40,7 +40,7 @@ import org.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class NettyUdpConnectedSendTest extends BaseNettyTest {
private static final String SEND_STRING = "***<We all love camel>***";
- private static final int SEND_COUNT = 20;
+ private static final int SEND_COUNT = 10;
private volatile int receivedCount;
private EventLoopGroup group;
private Bootstrap bootstrap;
http://git-wip-us.apache.org/repos/asf/camel/blob/bed325e1/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 d05ff05..f06d3de 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
@@ -69,7 +69,7 @@ public class NettyUseSharedWorkerThreadPoolManyRoutesTest extends BaseNettyTest
sharedBoosGroup = new NettyServerBossPoolBuilder().withBossCount(20).build();
jndi.bind("sharedBoss", sharedBoosGroup);
- for (int i = 0; i < 100; i++) {
+ for (int i = 0; i < 60; i++) {
from("netty4:tcp://localhost:" + getNextPort() + "?textline=true&sync=true&usingExecutorService=false"
+ "&bossGroup=#sharedBoss&workerGroup=#sharedWorker")
.validate(body().isInstanceOf(String.class))
@@ -80,4 +80,4 @@ public class NettyUseSharedWorkerThreadPoolManyRoutesTest extends BaseNettyTest
}
};
}
-}
\ No newline at end of file
+}