You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/11/23 08:22:08 UTC
camel git commit: Fixed test
Repository: camel
Updated Branches:
refs/heads/master 19a5eb392 -> 8d3973d43
Fixed test
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8d3973d4
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8d3973d4
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8d3973d4
Branch: refs/heads/master
Commit: 8d3973d43ce75a2b86672cb61ffc2dc719c31f5a
Parents: 19a5eb3
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Nov 23 08:21:42 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Mon Nov 23 08:21:42 2015 +0100
----------------------------------------------------------------------
.../disruptor/BasicDisruptorComponentTest.java | 50 --------------------
1 file changed, 50 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/8d3973d4/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/BasicDisruptorComponentTest.java
----------------------------------------------------------------------
diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/BasicDisruptorComponentTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/BasicDisruptorComponentTest.java
index fbd8a94..97b122e 100644
--- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/BasicDisruptorComponentTest.java
+++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/BasicDisruptorComponentTest.java
@@ -43,8 +43,6 @@ public class BasicDisruptorComponentTest extends CamelTestSupport {
@Produce(uri = "disruptor:test")
private ProducerTemplate template;
- private final ThreadCounter threadCounter = new ThreadCounter();
-
@Test
public void testProduce() throws InterruptedException {
resultEndpoint.expectedBodiesReceived(VALUE);
@@ -55,29 +53,6 @@ public class BasicDisruptorComponentTest extends CamelTestSupport {
resultEndpoint.assertIsSatisfied();
}
- @Test
- public void testMultipleConsumers() throws InterruptedException {
- threadCounter.reset();
-
- final int messagesSent = 1000;
-
- resultEndpoint.setExpectedMessageCount(messagesSent);
-
- for (int i = 0; i < messagesSent; ++i) {
- template.asyncSendBody("disruptor:testMultipleConsumers", VALUE);
- }
-
- resultEndpoint.await(20, TimeUnit.SECONDS);
-
- //sleep for another second to check for duplicate messages in transit
- Thread.sleep(1000);
-
- resultEndpoint.assertIsSatisfied();
-
- int count = threadCounter.getThreadIdCount();
- assertTrue("Should be " + count + " >= 4", count >= 4);
- }
-
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@@ -85,33 +60,8 @@ public class BasicDisruptorComponentTest extends CamelTestSupport {
public void configure() throws Exception {
from("disruptor:test")
.to("mock:result");
-
- from("disruptor:testMultipleConsumers?concurrentConsumers=4")
- .process(threadCounter)
- .to("mock:result");
}
};
}
- private static final class ThreadCounter implements Processor {
-
- private final Set<Long> threadIds = new HashSet<Long>();
-
- public void reset() {
- threadIds.clear();
- }
-
- @Override
- public void process(final Exchange exchange) throws Exception {
- threadIds.add(Thread.currentThread().getId());
- }
-
- public Set<Long> getThreadIds() {
- return Collections.unmodifiableSet(threadIds);
- }
-
- public int getThreadIdCount() {
- return threadIds.size();
- }
- }
}