camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/4] camel git commit: Fixed test
Date Fri, 20 Nov 2015 07:19:38 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x fd534e777 -> 37ce3d913
  refs/heads/master b7bede86a -> 352682148


Fixed test


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

Branch: refs/heads/master
Commit: 229517a91d0a948cf11ed8184179c19d4033d6c6
Parents: b7bede8
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Fri Nov 20 08:04:20 2015 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Fri Nov 20 08:04:20 2015 +0100

----------------------------------------------------------------------
 .../disruptor/BasicDisruptorComponentTest.java  | 41 ++++----------------
 1 file changed, 8 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/229517a9/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 6f5aa8d..67af198 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
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.disruptor;
 
 import java.util.Collections;
@@ -36,7 +35,7 @@ import org.junit.Test;
  * Tests some of the basic disruptor functionality
  */
 public class BasicDisruptorComponentTest extends CamelTestSupport {
-    private static final Integer VALUE = Integer.valueOf(42);
+    private static final Integer VALUE = 42;
     
     @EndpointInject(uri = "mock:result")
     private MockEndpoint resultEndpoint;
@@ -44,8 +43,6 @@ public class BasicDisruptorComponentTest extends CamelTestSupport {
     @Produce(uri = "disruptor:test")
     private ProducerTemplate template;
 
-    
-
     private final ThreadCounter threadCounter = new ThreadCounter();
 
     @Test
@@ -53,34 +50,11 @@ public class BasicDisruptorComponentTest extends CamelTestSupport {
         resultEndpoint.expectedBodiesReceived(VALUE);
         resultEndpoint.setExpectedMessageCount(1);
 
-        template.asyncSendBody("disruptor:test", VALUE);
+        template.sendBody("disruptor:test", VALUE);
 
-        resultEndpoint.await(5, TimeUnit.SECONDS);
         resultEndpoint.assertIsSatisfied();
     }
 
-
-    @Test
-    public void testAsynchronous() throws InterruptedException {
-        threadCounter.reset();
-
-        final int messagesSent = 1000;
-
-        resultEndpoint.setExpectedMessageCount(messagesSent);
-
-        final long currentThreadId = Thread.currentThread().getId();
-
-        for (int i = 0; i < messagesSent; ++i) {
-            template.asyncSendBody("disruptor:testAsynchronous", VALUE);
-        }
-
-        resultEndpoint.await(20, TimeUnit.SECONDS);
-        resultEndpoint.assertIsSatisfied();
-
-        assertTrue(threadCounter.getThreadIdCount() > 0);
-        assertFalse(threadCounter.getThreadIds().contains(currentThreadId));
-    }
-
     @Test
     public void testMultipleConsumers() throws InterruptedException {
         threadCounter.reset();
@@ -90,7 +64,7 @@ public class BasicDisruptorComponentTest extends CamelTestSupport {
         resultEndpoint.setExpectedMessageCount(messagesSent);
 
         for (int i = 0; i < messagesSent; ++i) {
-            template.asyncSendBody("disruptor:testMultipleConsumers?concurrentConsumers=4",
VALUE);
+            template.sendBody("disruptor:testMultipleConsumers", VALUE);
         }
 
         resultEndpoint.await(20, TimeUnit.SECONDS);
@@ -103,15 +77,16 @@ public class BasicDisruptorComponentTest extends CamelTestSupport {
         assertEquals(4, threadCounter.getThreadIdCount());
     }
 
-
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("disruptor:test").to("mock:result");
-                from("disruptor:testAsynchronous").process(threadCounter).to("mock:result");
-                from("disruptor:testMultipleConsumers?concurrentConsumers=4").process(threadCounter)
+                from("disruptor:test")
+                        .to("mock:result");
+
+                from("disruptor:testMultipleConsumers?concurrentConsumers=4")
+                        .process(threadCounter)
                         .to("mock:result");
             }
         };


Mime
View raw message