camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r798590 - /camel/branches/camel-1.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/discovery/JmsDiscoveryTest.java
Date Tue, 28 Jul 2009 16:08:59 GMT
Author: davsclaus
Date: Tue Jul 28 16:08:59 2009
New Revision: 798590

URL: http://svn.apache.org/viewvc?rev=798590&view=rev
Log:
Fixed unit test doing the same as trunk to make sure TC testing works reliable.

Modified:
    camel/branches/camel-1.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/discovery/JmsDiscoveryTest.java

Modified: camel/branches/camel-1.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/discovery/JmsDiscoveryTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/discovery/JmsDiscoveryTest.java?rev=798590&r1=798589&r2=798590&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/discovery/JmsDiscoveryTest.java
(original)
+++ camel/branches/camel-1.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/discovery/JmsDiscoveryTest.java
Tue Jul 28 16:08:59 2009
@@ -25,23 +25,27 @@
 import org.apache.camel.CamelContext;
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
 import static org.apache.camel.component.jms.JmsComponent.jmsComponentClientAcknowledge;
+import org.apache.camel.component.mock.MockEndpoint;
 
 /**
  * @version $Revision$
  */
 public class JmsDiscoveryTest extends ContextTestSupport {
+
     protected MyRegistry registry = new MyRegistry();
 
     public void testDiscovery() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedMinimumMessageCount(3);
+        mock.expectedMinimumMessageCount(1);
 
         assertMockEndpointsSatisfied();
 
+        // sleep a little
+        Thread.sleep(1000);
+
         Map<String, Map> map = new HashMap<String, Map>(registry.getServices());
-        assertTrue("There should be 3 or more, was: " + map.size(), map.size() >= 3);
+        assertTrue("There should be 1 or more, was: " + map.size(), map.size() >= 1);
     }
 
     protected CamelContext createCamelContext() throws Exception {
@@ -57,8 +61,6 @@
     protected Context createJndiContext() throws Exception {
         Context context = super.createJndiContext();
         context.bind("service1", new MyService("service1"));
-        context.bind("service2", new MyService("service2"));
-        context.bind("service3", new MyService("service3"));
         context.bind("registry", registry);
         return context;
     }
@@ -68,11 +70,10 @@
             public void configure() throws Exception {
                 // lets setup the heartbeats
                 from("bean:service1?method=status").to("activemq:topic:registry.heartbeats");
-                from("bean:service2?method=status").to("activemq:topic:registry.heartbeats");
-                from("bean:service3?method=status").to("activemq:topic:registry.heartbeats");
 
                 from("activemq:topic:registry.heartbeats").to("bean:registry?method=onEvent",
"mock:result");
             }
         };
     }
+
 }
\ No newline at end of file



Mime
View raw message