activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r530496 - /activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java
Date Thu, 19 Apr 2007 17:38:11 GMT
Author: chirino
Date: Thu Apr 19 10:38:06 2007
New Revision: 530496

URL: http://svn.apache.org/viewvc?view=rev&rev=530496
Log:
Cleaned up so that we can use as part of the documentation.


Modified:
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java?view=diff&rev=530496&r1=530495&r2=530496
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java
Thu Apr 19 10:38:06 2007
@@ -32,38 +32,33 @@
 public class PojoRouteTest extends TestCase {
 	
     public void testPojoRoutes() throws Exception {
-
-        CamelContext container = new DefaultCamelContext();
+    	
+        CamelContext camelContext = new DefaultCamelContext();
         
+        // START SNIPPET: register
         PojoComponent component = new PojoComponent();
+        camelContext.addComponent("pojo", component);
         component.addService("bye", new SayService("Good Bye!"));
-        container.addComponent("default", component);
+        // END SNIPPET: register
         
-        final AtomicInteger hitCount = new AtomicInteger();
-        final DelegateProcess<PojoExchange> tracingInterceptor = new DelegateProcess<PojoExchange>()
{
-        	@Override
-        	public void process(PojoExchange exchange) {
-        		super.process(exchange);
-        		hitCount.incrementAndGet();
-        	}
-        };
-        // lets add some routes
-        container.addRoutes(new RouteBuilder() {
+        // START SNIPPET: route
+        // lets add simple route
+        camelContext.addRoutes(new RouteBuilder() {
             public void configure() {
-                from("pojo:hello").intercept(tracingInterceptor).to("pojo:bye");
+                from("pojo:hello").to("pojo:bye");
             }
         });
+        // END SNIPPET: route
 
+        camelContext.start();
         
-        container.start();
-
-        // now lets fire in a message
+        // START SNIPPET: invoke
         PojoConsumer consumer = component.getConsumer("hello");        
         ISay proxy = consumer.createProxy(ISay.class);
         String rc = proxy.say();
         assertEquals("Good Bye!", rc);
-        assertEquals(1, hitCount.get());
+        // END SNIPPET: invoke
         
-        container.stop();
+        camelContext.stop();
     }
 }



Mime
View raw message