activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r530558 - /activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/queue/QueueRouteTest.java
Date Thu, 19 Apr 2007 21:35:12 GMT
Author: chirino
Date: Thu Apr 19 14:35:11 2007
New Revision: 530558

URL: http://svn.apache.org/viewvc?view=rev&rev=530558
Log:
Added disabled test case that shows that endpoint resolution is not conisistent across the
API.

Modified:
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/queue/QueueRouteTest.java

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/queue/QueueRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/queue/QueueRouteTest.java?view=diff&rev=530558&r1=530557&r2=530558
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/queue/QueueRouteTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/queue/QueueRouteTest.java
Thu Apr 19 14:35:11 2007
@@ -19,6 +19,7 @@
 
 import junit.framework.TestCase;
 import org.apache.camel.CamelContext;
+import org.apache.camel.Component;
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
@@ -70,4 +71,42 @@
 
         container.stop();
     }
+    
+    
+    public void xtestThatShowsEndpointResolutionIsNotConsistent() throws Exception {
+        final CountDownLatch latch = new CountDownLatch(1);
+
+        CamelContext container = new DefaultCamelContext();
+        
+        // lets add some routes
+        container.addRoutes(new RouteBuilder() {
+            public void configure() {
+                from("queue:test.a").to("queue:test.b");
+                from("queue:test.b").process(new Processor<Exchange>() {
+                    public void process(Exchange e) {
+                        System.out.println("Received exchange: " + e.getIn());
+                        latch.countDown();
+                    }
+                });
+            }
+        });
+
+        
+        container.start();
+        
+        // now lets fire in a message
+        Endpoint<Exchange> endpoint = container.getComponent("queue").resolveEndpoint("queue:test.a");
+        Exchange exchange = endpoint.createExchange();
+        exchange.getIn().setHeader("cheese", 123);
+
+        Producer<Exchange> producer = endpoint.createProducer();
+        producer.process(exchange);
+
+        // now lets sleep for a while
+        boolean received = latch.await(5, TimeUnit.SECONDS);
+        assertTrue("Did not receive the message!", received);
+
+        container.stop();
+    }
+    
 }



Mime
View raw message