camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r555016 - in /activemq/camel/trunk: camel-core/src/test/java/org/apache/camel/ components/camel-spring/src/main/java/org/apache/camel/spring/model/ components/camel-spring/src/main/java/org/apache/camel/spring/model/language/ components/cam...
Date Tue, 10 Jul 2007 17:47:47 GMT
Author: jstrachan
Date: Tue Jul 10 10:47:45 2007
New Revision: 555016

URL: http://svn.apache.org/viewvc?view=rev&rev=555016
Log:
added more test cases for parsing the XML using JAXB

Added:
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/InterceptorRef.java
      - copied, changed from r554993, activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorRef.java
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/RecipientListType.java
      - copied, changed from r554993, activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/FilterType.java
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/dynamicRecipientList.xml
      - copied, changed from r554600, activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildDynamicRecipientList.xml
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/language/HeaderExpression.java
      - copied, changed from r554993, activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/language/ELExpression.java
    activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithElFilter.xml
  (with props)
    activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithGroovyFilter.xml
  (with props)
    activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithHeaderFilter.xml
      - copied, changed from r554968, activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithFilter.xml
    activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/routeWithInterceptor.xml
      - copied, changed from r554600, activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildRouteWithInterceptor.xml
Modified:
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/TestSupport.java
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/FromType.java
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorRef.java
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/RouteType.java
    activemq/camel/trunk/components/camel-spring/src/main/resources/org/apache/camel/spring/model/jaxb.index
    activemq/camel/trunk/components/camel-spring/src/main/resources/org/apache/camel/spring/model/language/jaxb.index
    activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/model/GenerateXmlTest.java
    activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/model/XmlParseTest.java

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/TestSupport.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/TestSupport.java?view=diff&rev=555016&r1=555015&r2=555016
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/TestSupport.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/TestSupport.java Tue Jul
10 10:47:45 2007
@@ -24,6 +24,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import java.util.List;
+
 /**
  * A bunch of useful testing methods
  *
@@ -208,4 +210,8 @@
         return exchange;
     }
 
+    protected <T> T assertOneElement(List<T> list) {
+        assertEquals("Size of list should be 1: " + list, 1, list.size());
+        return list.get(0);
+    }
 }

Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/FromType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/FromType.java?view=diff&rev=555016&r1=555015&r2=555016
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/FromType.java
(original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/FromType.java
Tue Jul 10 10:47:45 2007
@@ -32,6 +32,13 @@
     @XmlAttribute
     private String uri;
 
+    public FromType() {
+    }
+
+    public FromType(String uri) {
+        setUri(uri);
+    }
+
     @Override
     public String toString() {
         return "From[" + uri + "]";

Copied: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/InterceptorRef.java
(from r554993, activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorRef.java)
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/InterceptorRef.java?view=diff&rev=555016&p1=activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorRef.java&r1=554993&p2=activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/InterceptorRef.java&r2=555016
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorRef.java
(original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/InterceptorRef.java
Tue Jul 10 10:47:45 2007
@@ -25,17 +25,23 @@
 /**
  * @version $Revision: 1.1 $
  */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlRootElement(name = "process")
-public class ProcessorRef extends OutputType {
-    @XmlAttribute(required = true)
+@XmlRootElement(name = "interceptor")
+public class InterceptorRef {
     private String ref;
 
+    public InterceptorRef() {
+    }
+
+    public InterceptorRef(String ref) {
+        setRef(ref);
+    }
+
     @Override
     public String toString() {
-        return "Processor[ref:  " + ref + "]";
+        return "Interceptor[ref:  " + ref + "]";
     }
 
+    @XmlAttribute(required = true)
     public String getRef() {
         return ref;
     }
@@ -43,4 +49,4 @@
     public void setRef(String ref) {
         this.ref = ref;
     }
-}
+}
\ No newline at end of file

Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorRef.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorRef.java?view=diff&rev=555016&r1=555015&r2=555016
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorRef.java
(original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/ProcessorRef.java
Tue Jul 10 10:47:45 2007
@@ -25,10 +25,8 @@
 /**
  * @version $Revision: 1.1 $
  */
-@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "process")
 public class ProcessorRef extends OutputType {
-    @XmlAttribute(required = true)
     private String ref;
 
     @Override
@@ -36,6 +34,7 @@
         return "Processor[ref:  " + ref + "]";
     }
 
+    @XmlAttribute(required = true)
     public String getRef() {
         return ref;
     }

Copied: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/RecipientListType.java
(from r554993, activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/FilterType.java)
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/RecipientListType.java?view=diff&rev=555016&p1=activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/FilterType.java&r1=554993&p2=activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/RecipientListType.java&r2=555016
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/FilterType.java
(original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/RecipientListType.java
Tue Jul 10 10:47:45 2007
@@ -27,15 +27,15 @@
 /**
  * @version $Revision: 1.1 $
  */
-@XmlRootElement(name = "filter")
+@XmlRootElement(name = "recipientList")
 @XmlAccessorType(XmlAccessType.FIELD)
-public class FilterType extends OutputType {
+public class RecipientListType extends OutputType {
     @XmlElementRef
     private ExpressionType expression;
 
     @Override
     public String toString() {
-        return "Filter[if: " + getExpression() + " process: " + getProcessor() + "]";
+        return "RecipientList[ " + getExpression()  + "]";
     }
 
     public ExpressionType getExpression() {
@@ -45,4 +45,4 @@
     public void setExpression(ExpressionType expression) {
         this.expression = expression;
     }
-}
+}
\ No newline at end of file

Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/RouteType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/RouteType.java?view=diff&rev=555016&r1=555015&r2=555016
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/RouteType.java
(original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/RouteType.java
Tue Jul 10 10:47:45 2007
@@ -25,6 +25,7 @@
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlElementRef;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -37,6 +38,7 @@
 public class RouteType extends OutputType implements CamelContextAware, ProcessorFactory
{
     private CamelContext camelContext;
     private List<FromType> from = new ArrayList<FromType>();
+    private List<InterceptorRef> interceptors = new ArrayList<InterceptorRef>();
 
 /*
     public Route createRoute() throws Exception {
@@ -61,6 +63,15 @@
         this.from = from;
     }
 
+    @XmlElementRef
+    public List<InterceptorRef> getInterceptors() {
+        return interceptors;
+    }
+
+    public void setInterceptors(List<InterceptorRef> interceptors) {
+        this.interceptors = interceptors;
+    }
+
     @XmlTransient
     public CamelContext getCamelContext() {
         return camelContext;
@@ -89,9 +100,19 @@
     // Fluent API
     //-----------------------------------------------------------------------
     public RouteType from(String uri) {
-        FromType from = new FromType();
-        from.setUri(uri);
-        getFrom().add(from);
+        getFrom().add(new FromType(uri));
+        return this;
+    }
+
+    public RouteType interceptor(String ref) {
+        getInterceptors().add(new InterceptorRef(ref));
+        return this;
+    }
+
+    public RouteType interceptors(String... refs) {
+        for (String ref : refs) {
+            interceptor(ref);
+        }
         return this;
     }
 }

Copied: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/dynamicRecipientList.xml
(from r554600, activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildDynamicRecipientList.xml)
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/dynamicRecipientList.xml?view=diff&rev=555016&p1=activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildDynamicRecipientList.xml&r1=554600&p2=activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/dynamicRecipientList.xml&r2=555016
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildDynamicRecipientList.xml
(original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/dynamicRecipientList.xml
Tue Jul 10 10:47:45 2007
@@ -15,28 +15,12 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="
-       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
-       http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
-    ">
 
-  <!--
-        from("seda:a").recipientList(header("foo"));
-  -->
-  <!-- START SNIPPET: example -->
-  <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
-    <route>
-      <from uri="seda:a"/>
-      <recipientList>
-        <recipients>
-          <header name="foo"/>
-        </recipients>
-      </recipientList>
-    </route>
-  </camelContext>
-  <!-- END SNIPPET: example -->
-
-
-</beans>
+<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
+  <route>
+    <from uri="seda:a"/>
+    <recipientList>
+      <header>foo</header>
+    </recipientList>
+  </route>
+</camelContext>

Copied: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/language/HeaderExpression.java
(from r554993, activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/language/ELExpression.java)
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/language/HeaderExpression.java?view=diff&rev=555016&p1=activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/language/ELExpression.java&r1=554993&p2=activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/language/HeaderExpression.java&r2=555016
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/language/ELExpression.java
(original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/model/language/HeaderExpression.java
Tue Jul 10 10:47:45 2007
@@ -20,20 +20,20 @@
 import javax.xml.bind.annotation.XmlRootElement;
 
 /**
- * For EL expresions and predicates
+ * An expression which extracts the named header
  *
  * @version $Revision: 1.1 $
  */
-@XmlRootElement(name = "el")
-public class ELExpression extends ExpressionType {
-    public ELExpression() {
+@XmlRootElement(name = "header")
+public class HeaderExpression extends ExpressionType {
+    public HeaderExpression() {
     }
 
-    public ELExpression(String expression) {
+    public HeaderExpression(String expression) {
         super(expression);
     }
 
     public String getLanguage() {
-        return "el";
+        return "header";
     }
 }

Modified: activemq/camel/trunk/components/camel-spring/src/main/resources/org/apache/camel/spring/model/jaxb.index
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/resources/org/apache/camel/spring/model/jaxb.index?view=diff&rev=555016&r1=555015&r2=555016
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/resources/org/apache/camel/spring/model/jaxb.index
(original)
+++ activemq/camel/trunk/components/camel-spring/src/main/resources/org/apache/camel/spring/model/jaxb.index
Tue Jul 10 10:47:45 2007
@@ -2,5 +2,6 @@
 FilterType
 FromType
 ProcessorRef
+RecipientListType
 RouteType
 ToType

Modified: activemq/camel/trunk/components/camel-spring/src/main/resources/org/apache/camel/spring/model/language/jaxb.index
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/resources/org/apache/camel/spring/model/language/jaxb.index?view=diff&rev=555016&r1=555015&r2=555016
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/resources/org/apache/camel/spring/model/language/jaxb.index
(original)
+++ activemq/camel/trunk/components/camel-spring/src/main/resources/org/apache/camel/spring/model/language/jaxb.index
Tue Jul 10 10:47:45 2007
@@ -1,5 +1,6 @@
 ELExpression
 GroovyExpression
+HeaderExpression
 JavaScriptExpression
 LanguageExpression
 OgnlExpression

Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/model/GenerateXmlTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/model/GenerateXmlTest.java?view=diff&rev=555016&r1=555015&r2=555016
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/model/GenerateXmlTest.java
(original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/model/GenerateXmlTest.java
Tue Jul 10 10:47:45 2007
@@ -41,6 +41,7 @@
         CamelContextType context = new CamelContextType();
         RouteType route = context.route();
         route.from("seda:a");
+        route.interceptors("interceptor1", "interceptor2");
         route.filter(new GroovyExpression("in.headers.any { h -> h.startsWith('foo') }")).
                 to("seda:b");
 

Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/model/XmlParseTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/model/XmlParseTest.java?view=diff&rev=555016&r1=555015&r2=555016
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/model/XmlParseTest.java
(original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/model/XmlParseTest.java
Tue Jul 10 10:47:45 2007
@@ -17,19 +17,121 @@
  */
 package org.apache.camel.spring.model;
 
+import org.apache.camel.Route;
+import org.apache.camel.spring.model.language.ExpressionType;
+
+import javax.xml.bind.JAXBException;
+import java.util.List;
+
 /**
  * @version $Revision: 1.1 $
  */
 public class XmlParseTest extends XmlTestSupport {
     public void testParseExample1Xml() throws Exception {
-        assertParseAsJaxb("example1.xml");
+        RouteType route = assertOneRoute("example1.xml");
+        assertFrom(route, "seda:a");
+        assertTo(route, "seda:b");
     }
 
     public void testParseProcessorXml() throws Exception {
-        assertParseAsJaxb("processor.xml");
+        RouteType route = assertOneRoute("processor.xml");
+        assertFrom(route, "seda:a");
+        assertProcessor(route, "myProcessor");
     }
 
     public void testParseProcessorWithFilterXml() throws Exception {
-        assertParseAsJaxb("processorWithFilter.xml");
+        RouteType route = assertOneRoute("processorWithFilter.xml");
+        assertFrom(route, "seda:a");
+        FilterType filter = assertFilter(route);
+        assertExpression(filter.getExpression(), "juel", "in.header.foo == 'bar'");
+    }
+
+    public void testParseProcessorWithHeaderFilterXml() throws Exception {
+        RouteType route = assertOneRoute("processorWithHeaderFilter.xml");
+        assertFrom(route, "seda:a");
+        FilterType filter = assertFilter(route);
+        assertExpression(filter.getExpression(), "header", "foo");
+    }
+
+    public void testParseProcessorWithElFilterXml() throws Exception {
+        RouteType route = assertOneRoute("processorWithElFilter.xml");
+        assertFrom(route, "seda:a");
+        FilterType filter = assertFilter(route);
+        assertExpression(filter.getExpression(), "el", "$in.header.foo == 'bar'");
+    }
+
+    public void testParseProcessorWithGroovyFilterXml() throws Exception {
+        RouteType route = assertOneRoute("processorWithGroovyFilter.xml");
+        assertFrom(route, "seda:a");
+        FilterType filter = assertFilter(route);
+        assertExpression(filter.getExpression(), "groovy", "in.headers.any { h -> h.startsWith('foo')}");
+    }
+
+    public void testParseRecipientListXml() throws Exception {
+        RouteType route = assertOneRoute("dynamicRecipientList.xml");
+        assertFrom(route, "seda:a");
+        RecipientListType node = assertRecipientList(route);
+        assertExpression(node.getExpression(), "header", "foo");
+    }
+
+    public void testParseRouteWithInterceptorXml() throws Exception {
+        RouteType route = assertOneRoute("routeWithInterceptor.xml");
+        assertFrom(route, "seda:a");
+        assertTo(route, "seda:d");
+        assertInterceptorRefs(route, "interceptor1", "interceptor2");
+    }
+
+    // Implementation methods
+    //-------------------------------------------------------------------------
+
+    protected RouteType assertOneRoute(String uri) throws JAXBException {
+        CamelContextType context = assertParseAsJaxb(uri);
+        RouteType route = assertOneElement(context.getRoutes());
+        return route;
+    }
+
+    protected void assertProcessor(RouteType route, String processorRef) {
+        ProcessorType processor = assertOneElement(route.getProcessor());
+        ProcessorRef to = assertIsInstanceOf(ProcessorRef.class, processor);
+        assertEquals("Processor ref", processorRef, to.getRef());
+    }
+
+    protected void assertTo(RouteType route, String uri) {
+        ProcessorType processor = assertOneElement(route.getProcessor());
+        ToType value = assertIsInstanceOf(ToType.class, processor);
+        assertEquals("To URI", uri, value.getUri());
+    }
+
+    protected void assertFrom(RouteType route, String uri) {
+        FromType from = assertOneElement(route.getFrom());
+        assertEquals("From URI", uri, from.getUri());
+    }
+
+    protected FilterType assertFilter(RouteType route) {
+        ProcessorType processor = assertOneElement(route.getProcessor());
+        return assertIsInstanceOf(FilterType.class, processor);
+    }
+
+    protected RecipientListType assertRecipientList(RouteType route) {
+        ProcessorType processor = assertOneElement(route.getProcessor());
+        return assertIsInstanceOf(RecipientListType.class, processor);
+    }
+
+    protected void assertExpression(ExpressionType expression, String language, String languageExpression)
{
+        assertNotNull("Expression should not be null!", expression);
+        assertEquals("Expression language", language, expression.getLanguage());
+        assertEquals("Expression", languageExpression, expression.getExpression());
+    }
+
+    protected void assertInterceptorRefs(RouteType route, String... names) {
+        int idx = 0;
+        List<InterceptorRef> interceptors = route.getInterceptors();
+        for (String name : names) {
+            int nextIdx = idx + 1;
+            assertTrue("Not enough interceptors! Expected: " + nextIdx + " but have: " +
interceptors, nextIdx <= interceptors.size());
+            
+            InterceptorRef interceptor = interceptors.get(idx++);
+            assertEquals("Interceptor: " + idx, name, interceptor.getRef());
+        }
     }
 }

Added: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithElFilter.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithElFilter.xml?view=auto&rev=555016
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithElFilter.xml
(added)
+++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithElFilter.xml
Tue Jul 10 10:47:45 2007
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+   
+    http://www.apache.org/licenses/LICENSE-2.0
+   
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
+  <route>
+    <from uri="seda:a"/>
+    <filter>
+      <el>$in.header.foo == 'bar'</el>
+      <process ref="myProcessor"/>
+    </filter>
+  </route>
+</camelContext>

Propchange: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithElFilter.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithGroovyFilter.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithGroovyFilter.xml?view=auto&rev=555016
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithGroovyFilter.xml
(added)
+++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithGroovyFilter.xml
Tue Jul 10 10:47:45 2007
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+   
+    http://www.apache.org/licenses/LICENSE-2.0
+   
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
+  <route>
+    <from uri="seda:a"/>
+    <filter>
+      <groovy>in.headers.any { h -> h.startsWith('foo')}</groovy>
+      <process ref="myProcessor"/>
+    </filter>
+  </route>
+</camelContext>

Propchange: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithGroovyFilter.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithHeaderFilter.xml
(from r554968, activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithFilter.xml)
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithHeaderFilter.xml?view=diff&rev=555016&p1=activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithFilter.xml&r1=554968&p2=activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithHeaderFilter.xml&r2=555016
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithFilter.xml
(original)
+++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/processorWithHeaderFilter.xml
Tue Jul 10 10:47:45 2007
@@ -19,7 +19,7 @@
   <route>
     <from uri="seda:a"/>
     <filter>
-      <expression language="juel">in.header.foo == 'bar'</expression>
+      <header>foo</header>
       <process ref="myProcessor"/>
     </filter>
   </route>

Copied: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/routeWithInterceptor.xml
(from r554600, activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildRouteWithInterceptor.xml)
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/routeWithInterceptor.xml?view=diff&rev=555016&p1=activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildRouteWithInterceptor.xml&r1=554600&p2=activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/routeWithInterceptor.xml&r2=555016
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildRouteWithInterceptor.xml
(original)
+++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/model/routeWithInterceptor.xml
Tue Jul 10 10:47:45 2007
@@ -15,35 +15,11 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="
-       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
-       http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
-    ">
-
-  <!--
-        from("seda:a")
-           .intercept()
-              .add(interceptor1)
-              .add(interceptor2)
-           .target().to("seda:d");
-  -->
-  <!-- START SNIPPET: example -->
-  <bean id="interceptor1" class="org.apache.camel.builder.MyInterceptorProcessor"/>
-  <bean id="interceptor2" class="org.apache.camel.builder.MyInterceptorProcessor"/>
-
-  <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
-    <route>
-      <from uri="seda:a"/>
-      <intercept>
-        <interceptor ref="interceptor1"/>
-        <interceptor ref="interceptor2"/>
-      </intercept>
-      <to uri="seda:d"/>
-    </route>
-  </camelContext>
-  <!-- END SNIPPET: example -->
-
-
-</beans>
+<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
+  <route>
+    <from uri="seda:a"/>
+    <interceptor ref="interceptor1"/>
+    <interceptor ref="interceptor2"/>
+    <to uri="seda:d"/>
+  </route>
+</camelContext>



Mime
View raw message