activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r521439 - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/builder/ camel-spring/src/main/resources/org/apache/camel/spring/ camel-spring/src/test/java/org/apache/camel/spring/builder/ camel-spring/src/test/resources/org/...
Date Thu, 22 Mar 2007 20:19:23 GMT
Author: chirino
Date: Thu Mar 22 13:19:22 2007
New Revision: 521439

URL: http://svn.apache.org/viewvc?view=rev&rev=521439
Log:
Fixed splitter test case.  Now all test cases in RouteBuilderTest are implemented in spring
XML.


Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java
    activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd
    activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/builder/SpringRouteBuilderTest.java
    activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml
    activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/examples.xml

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java?view=diff&rev=521439&r1=521438&r2=521439
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java
Thu Mar 22 13:19:22 2007
@@ -183,7 +183,7 @@
      * @return the builder
      */
     @Fluent
-    public SplitterBuilder<E> splitter(@FluentArg("receipients") ValueBuilder<E>
receipients) {
+    public SplitterBuilder<E> splitter(@FluentArg(value="recipients", element=true)
ValueBuilder<E> receipients) {
         SplitterBuilder<E> answer = new SplitterBuilder<E>(this, receipients);
         addProcessBuilder(answer);
         return answer;

Modified: activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd?view=diff&rev=521439&r1=521438&r2=521439
==============================================================================
--- activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd
(original)
+++ activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd
Thu Mar 22 13:19:22 2007
@@ -29,12 +29,13 @@
           <xs:element minOccurs="0" maxOccurs="unbounded" ref="c:filter"/>
           <xs:element minOccurs="0" maxOccurs="unbounded" ref="c:intercept"/>
         </xs:choice>
-        <xs:choice>
-          <xs:element ref="c:to"/>
+        <xs:choice minOccurs="0">
           <xs:element ref="c:choice"/>
           <xs:element ref="c:process"/>
           <xs:element ref="c:recipientList"/>
         </xs:choice>
+        <xs:element minOccurs="0" ref="c:splitter"/>
+        <xs:element minOccurs="0" ref="c:to"/>
       </xs:sequence>
     </xs:complexType>
   </xs:element>
@@ -90,21 +91,8 @@
       <xs:attribute name="ref" use="required"/>
     </xs:complexType>
   </xs:element>
-  <xs:element name="recipientList">
-    <xs:complexType>
-      <xs:sequence>
-        <xs:element ref="c:recipients"/>
-      </xs:sequence>
-    </xs:complexType>
-  </xs:element>
-  <xs:element name="recipients">
-    <xs:complexType>
-      <xs:choice>
-        <xs:element ref="c:body"/>
-        <xs:element ref="c:header"/>
-      </xs:choice>
-    </xs:complexType>
-  </xs:element>
+  <xs:element name="recipientList" type="c:recipients"/>
+  <xs:element name="splitter" type="c:recipients"/>
   <xs:complexType name="predicate">
     <xs:sequence>
       <xs:element ref="c:predicate"/>
@@ -146,6 +134,35 @@
     </xs:complexType>
   </xs:element>
   <xs:element name="uri" type="xs:NMTOKEN"/>
+  <xs:complexType name="recipients">
+    <xs:sequence>
+      <xs:element ref="c:recipients"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="recipients">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice minOccurs="0">
+          <xs:element ref="c:header"/>
+          <xs:element ref="c:bodyAs"/>
+        </xs:choice>
+        <xs:choice minOccurs="0">
+          <xs:element ref="c:body"/>
+          <xs:element ref="c:tokenize"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bodyAs">
+    <xs:complexType>
+      <xs:attribute name="class" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tokenize">
+    <xs:complexType>
+      <xs:attribute name="token" use="required"/>
+    </xs:complexType>
+  </xs:element>
   <xs:element name="header">
     <xs:complexType>
       <xs:attribute name="name" use="required"/>

Modified: activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/builder/SpringRouteBuilderTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/builder/SpringRouteBuilderTest.java?view=diff&rev=521439&r1=521438&r2=521439
==============================================================================
--- activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/builder/SpringRouteBuilderTest.java
(original)
+++ activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/builder/SpringRouteBuilderTest.java
Thu Mar 22 13:19:22 2007
@@ -108,7 +108,15 @@
 	
 	@Override
 	protected RouteBuilder<Exchange> buildStaticRecipientList() {
-		// TODO Auto-generated method stub
-		return super.buildStaticRecipientList();
+		RouteBuilder<Exchange> builder = (RouteBuilder<Exchange>) ctx.getBean("buildStaticRecipientList");
+		assertNotNull(builder);
+		return builder;
+	}
+	
+	@Override
+	protected RouteBuilder<Exchange> buildSplitter() {
+		RouteBuilder<Exchange> builder = (RouteBuilder<Exchange>) ctx.getBean("buildSplitter");
+		assertNotNull(builder);
+		return builder;
 	}
 }

Modified: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml?view=diff&rev=521439&r1=521438&r2=521439
==============================================================================
--- activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml
(original)
+++ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml
Thu Mar 22 13:19:22 2007
@@ -153,6 +153,39 @@
        </route>
     </routeBuilder>
     
+                    
+    <!-- 
+        from("queue:a").to("queue:b", "queue:c", "queue:d");
+     -->
+    <routeBuilder id="buildStaticRecipientList" xmlns="http://activemq.apache.org/camel/schema/camel-1.0.xsd">
+       <route>
+         <from uri="queue:a"/>
+         <to>
+            <uri>queue:b</uri>
+            <uri>queue:c</uri>
+            <uri>queue:d</uri>
+         </to>
+       </route>
+    </routeBuilder>
+                    
+    
+                    
+    <!-- 
+        from("queue:a").splitter(bodyAs(String.class).tokenize("\n")).to("queue:b");
+     -->
+    <routeBuilder id="buildSplitter" xmlns="http://activemq.apache.org/camel/schema/camel-1.0.xsd">
+       <route>
+         <from uri="queue:a"/>
+         <splitter>
+         	<recipients>
+	            <bodyAs class="java.lang.String"/>
+	            <tokenize token="
+"/>
+         	</recipients>
+         </splitter>
+         <to uri="queue:b"/>
+       </route>
+    </routeBuilder>
 
 </beans>
 <!-- END SNIPPET: example -->

Modified: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/examples.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/examples.xml?view=diff&rev=521439&r1=521438&r2=521439
==============================================================================
--- activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/examples.xml
(original)
+++ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/examples.xml
Thu Mar 22 13:19:22 2007
@@ -136,6 +136,16 @@
        
        <route>
          <from uri="queue:a"/>
+         <recipientList>
+         	<recipients>
+              <header name=""/>
+              <tokenize token=","/>
+            </recipients>
+         </recipientList>
+       </route>
+       
+       <route>
+         <from uri="queue:a"/>
          <filter>
              <predicate>
                 <body/>
@@ -147,6 +157,19 @@
               <body/>
             </recipients>
          </recipientList>
+       </route>
+       
+       
+       <route>
+         <from uri="queue:a"/>
+         <splitter>
+         	<recipients>
+	            <bodyAs class="java.lang.String"/>
+	            <tokenize token="
+"/>
+         	</recipients>
+         </splitter>
+         <to uri="queue:b"/>
        </route>
        
     </routeBuilder>



Mime
View raw message