camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: Fixed test
Date Mon, 23 Nov 2015 07:22:20 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x 3f03f4421 -> 1951fd560


Fixed test


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1951fd56
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1951fd56
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1951fd56

Branch: refs/heads/camel-2.16.x
Commit: 1951fd56057aa5df4e4c1b17041fb62d03b3c0b6
Parents: 3f03f44
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Mon Nov 23 08:21:42 2015 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Nov 23 08:22:14 2015 +0100

----------------------------------------------------------------------
 .../disruptor/BasicDisruptorComponentTest.java  | 50 --------------------
 1 file changed, 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/1951fd56/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();
-        }
-    }
 }


Mime
View raw message