camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r1445903 - in /camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel: component/vm/VmMultipleConsumersIssueTest.java component/vm/VmMultipleContextsStartStopTest.java issues/SedaMultipleConsumersIssueTest.java
Date Wed, 13 Feb 2013 20:25:38 GMT
Author: raulk
Date: Wed Feb 13 20:25:38 2013
New Revision: 1445903

URL: http://svn.apache.org/r1445903
Log:
Fix VmMultipleContextsStartStopTest to stop the second context so that itit doesn't interfere
with other tests. Rename and move a test from Seda to VM.

Added:
    camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/component/vm/VmMultipleConsumersIssueTest.java
      - copied unchanged from r1445896, camel/trunk/camel-core/src/test/java/org/apache/camel/component/vm/VmMultipleConsumersIssueTest.java
Removed:
    camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/issues/SedaMultipleConsumersIssueTest.java
Modified:
    camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/component/vm/VmMultipleContextsStartStopTest.java

Modified: camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/component/vm/VmMultipleContextsStartStopTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/component/vm/VmMultipleContextsStartStopTest.java?rev=1445903&r1=1445902&r2=1445903&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/component/vm/VmMultipleContextsStartStopTest.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/component/vm/VmMultipleContextsStartStopTest.java
Wed Feb 13 20:25:38 2013
@@ -16,49 +16,25 @@
  */
 package org.apache.camel.component.vm;
 
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.ProducerTemplate;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.impl.DefaultCamelContext;
 
 /**
  * @version 
  */
-public class VmMultipleContextsStartStopTest extends ContextTestSupport {
+public class VmMultipleContextsStartStopTest extends AbstractVmTestSupport {
 
     public void testStartStop() throws Exception {
-        DefaultCamelContext c1 = new DefaultCamelContext();
-        c1.addRoutes(new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-                from("direct:test")
-                    .to("vm:foo");
-            }
-        });
-        c1.start();
-        ProducerTemplate template = c1.createProducerTemplate();
-
-        DefaultCamelContext c2 = new DefaultCamelContext();
-        c2.addRoutes(new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-                from("vm:foo")
-                    .to("mock:result");
-            }
-        });
-        c2.start();
-        
         /* Check that contexts are communicated */
-        MockEndpoint mock = c2.getEndpoint("mock:result", MockEndpoint.class);
+        MockEndpoint mock = context2.getEndpoint("mock:result", MockEndpoint.class);
         mock.expectedMessageCount(1);
         template.requestBody("direct:test", "Hello world!");
         mock.assertIsSatisfied();
         mock.reset();
         
         /* Restart the consumer Camel Context */
-        c2.stop();
-        c2.start();
+        context2.stop();
+        context2.start();
         
         /* Send a message again and assert that it's received */
         template.requestBody("direct:test", "Hello world!");
@@ -71,8 +47,20 @@ public class VmMultipleContextsStartStop
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
+                from("direct:test").to("vm:foo");
+            }
+        };
+    }
 
+    @Override
+    protected RouteBuilder createRouteBuilderForSecondContext() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("vm:foo").to("mock:result");            
             }
         };
+       
     }
+    
 }
\ No newline at end of file



Mime
View raw message