activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r520564 - /activemq/camel/trunk/camel-xbean/src/test/resources/org/apache/camel/xbean/xbean_route_builder_test.xml
Date Tue, 20 Mar 2007 20:42:18 GMT
Author: chirino
Date: Tue Mar 20 13:42:17 2007
New Revision: 520564

URL: http://svn.apache.org/viewvc?view=rev&rev=520564
Log:
made xml more ideal

Modified:
    activemq/camel/trunk/camel-xbean/src/test/resources/org/apache/camel/xbean/xbean_route_builder_test.xml

Modified: activemq/camel/trunk/camel-xbean/src/test/resources/org/apache/camel/xbean/xbean_route_builder_test.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xbean/src/test/resources/org/apache/camel/xbean/xbean_route_builder_test.xml?view=diff&rev=520564&r1=520563&r2=520564
==============================================================================
--- activemq/camel/trunk/camel-xbean/src/test/resources/org/apache/camel/xbean/xbean_route_builder_test.xml
(original)
+++ activemq/camel/trunk/camel-xbean/src/test/resources/org/apache/camel/xbean/xbean_route_builder_test.xml
Tue Mar 20 13:42:17 2007
@@ -22,22 +22,26 @@
         from("queue:a").to("queue:b");
 	 -->
 	<RouteBuilder id="buildSimpleRoute">
-		<routes>
-		  <route from="queue:a" to="queue:b"/>
-		</routes>
+	   <routes>
+	      <route>
+			<from uri="queue:a"/>
+			<to uri="queue:b"/>
+	      </route>
+	   </routes>
 	</RouteBuilder>
 	
 	<!-- 
 		from("queue:a").process(myProcessor);
 	 -->
 	<RouteBuilder id="buildCustomProcessor">
-		<routes>
-		  <route from="queue:a">
-		  	<processor>
-		  	  <bean class="some.Processor"/>
-		  	</processor>		  	
-		  </route>
-		</routes>
+	   <routes>
+	      <route>
+			<from uri="queue:a"/>
+			<processor>
+		  	  <bean id="myProcessor" class="some.Processor"/>
+			</processor>
+	      </route>
+	   </routes>
 	</RouteBuilder>
 
 
@@ -45,9 +49,20 @@
         from("queue:a").filter(headerEquals("foo", "bar")).process(myProcessor);
 	 -->
 	<RouteBuilder id="buildCustomProcessorWithFilter">
-		<routes>
-		   <!-- TODO -->
-		</routes>
+	   <routes>
+	      <route>
+			<from uri="queue:a"/>
+			<filter>
+				<predicate>
+				   <header name="foo"/>
+				   <equalTo value="bar"/>
+				</predicate>
+			</filter>
+			<processor>
+		  	  <bean class="some.Processor"/>
+			</processor>
+	      </route>
+	   </routes>
 	</RouteBuilder>
 
 	<!-- 
@@ -58,39 +73,83 @@
    	       .target().to("queue:d");
 	 -->
 	<RouteBuilder id="buildRouteWithInterceptor">
-		<routes>
-		   <!-- TODO -->
-		</routes>
+	   <routes>
+	      <route>
+			<from uri="queue:a"/>
+			<intercept>
+				<bean id="interceptor1" class="some.InterceptorProcessor"/>
+				<bean id="interceptor2" class="some.InterceptorProcessor"/>
+			</intercept>
+			<to uri="queue:b"/>
+	      </route>
+	   </routes>
 	</RouteBuilder>
 
 	<!-- 
         from("queue:a").choice()
-                .when(headerEquals("foo", "bar")).to("queue:b")
-                .when(headerEquals("foo", "cheese")).to("queue:c")
+                .when(header("foo").isEqualTo("bar")).to("queue:b")
+                .when(header("foo").isEqualTo("cheese")).to("queue:c")
                 .otherwise().to("queue:d");
 	 -->
-	<RouteBuilder id="buildSimpleRouteWithChoice">
-		<routes>
-		   <!-- TODO -->
-		</routes>
-	</RouteBuilder>
+	<routeBuilder id="buildSimpleRouteWithChoice">
+	   <routes>
+	      <route>
+			<from uri="queue:a"/>
+			<choice>
+				<when>
+					<predicate>
+					   <header name="foo"/>
+					   <equalTo value="bar"/>
+					</predicate>
+  				    <to uri="queue:b"/>
+				</when>
+				
+				<when>
+					<predicate>
+					   <header name="foo"/>
+					   <equalTo value="cheese"/>
+					</predicate>
+				    <to uri="queue:c"/>
+				</when>
+				<otherwise>
+					<to uri="queue:d"/>
+				</otherwise>
+			</choice>
+	      </route>
+	   </routes>
+	</routeBuilder>
 
 	<!-- 
         from("queue:a").filter(headerEquals("foo", "bar")).to("queue:b");
 	 -->
 	<RouteBuilder id="buildSimpleRouteWithHeaderPredicate">
-		<routes>
-		   <!-- TODO -->
-		</routes>
+	   <routes>
+	      <route>
+			<from uri="queue:a"/>
+			<filter>
+				<predicate>
+				   <header name="foo"/>
+				   <equalTo value="bar"/>
+				</predicate>
+			</filter>
+			<to uri="queue:b"/>
+	      </route>
+	   </routes>
 	</RouteBuilder>
 
 	<!-- 
         from("queue:a").to("queue:tap", "queue:b");
 	 -->
 	<RouteBuilder id="buildWireTap">
-		<routes>
-		   <!-- TODO -->
-		</routes>
+	   <routes>
+	      <route>
+			<from uri="queue:a"/>
+			<to>
+			   <uri>queue:tap</uri>
+			   <uri>queue:a</uri>
+			</to>
+	      </route>
+	   </routes>
 	</RouteBuilder>
 
 </beans>



Mime
View raw message