svn commit: r679483 - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/language/ camel-core/src/main/java/org/apache/camel/language/constant/ camel-core/src/main/java/org/apache/camel/model/ camel-core/src/main/java/org/apache/camel/...

View: New views
1 Messages — Rating Filter:   Alert me  

svn commit: r679483 - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/language/ camel-core/src/main/java/org/apache/camel/language/constant/ camel-core/src/main/java/org/apache/camel/model/ camel-core/src/main/java/org/apache/camel/...

by davsclaus-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Author: davsclaus
Date: Thu Jul 24 11:37:04 2008
New Revision: 679483

URL: http://svn.apache.org/viewvc?rev=679483&view=rev
Log:
CAMEL-746: Applied patch with thanks to Jonathan. Great work man, we always appreciate your effort to keep the Spring DSL up-to-date.

Added:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/Constant.java   (with props)
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/constant/
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/constant/ConstantLanguage.java   (with props)
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderType.java   (with props)
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ConstantExpression.java   (with props)
    activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/language/constant   (with props)
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/language/ConstantTest.java   (with props)
    activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setOutHeader.xml   (with props)
    activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setOutHeaderToConstant.xml   (with props)
    activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringSetOutHeaderTest.java
    activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringSetOutHeaderWithConstantTest.java
    activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/setOutHeader.xml   (with props)
    activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/setOutHeaderWithConstant.xml   (with props)
Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SetHeaderType.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ELExpression.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/GroovyExpression.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/JXPathExpression.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/JavaScriptExpression.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/MethodCallExpression.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/OgnlExpression.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PhpExpression.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PythonExpression.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/RubyExpression.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SimpleExpression.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SqlExpression.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XPathExpression.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XQueryExpression.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/SetHeaderProcessor.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/TransformProcessor.java
    activemq/camel/trunk/camel-core/src/main/resources/org/apache/camel/model/jaxb.index
    activemq/camel/trunk/camel-core/src/main/resources/org/apache/camel/model/language/jaxb.index
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/model/XmlParseTest.java
    activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setHeaderToConstant.xml
    activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setHeaderWithChildProcessor.xml
    activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringSetHeaderWithChildProcessorTest.java
    activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringSetHeaderTestWithChildProcessor-context.xml
    activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringSetHeaderWithConstantTest-context.xml

Added: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/Constant.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/Constant.java?rev=679483&view=auto
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/Constant.java (added)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/Constant.java Thu Jul 24 11:37:04 2008
@@ -0,0 +1,34 @@
+/**
+ * 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.
+ */
+package org.apache.camel.language;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Used to inject a constant expression into a field, property, method or parameter when using
+ * <a href="http://activemq.apache.org/camel/bean-integration.html">Bean Integration</a>.
+ *
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
+@LanguageAnnotation(language = "constant")
+public @interface Constant {
+    String value();
+}

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/Constant.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/Constant.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/constant/ConstantLanguage.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/constant/ConstantLanguage.java?rev=679483&view=auto
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/constant/ConstantLanguage.java (added)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/constant/ConstantLanguage.java Thu Jul 24 11:37:04 2008
@@ -0,0 +1,42 @@
+/**
+ * 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.
+ */
+package org.apache.camel.language.constant;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Expression;
+import org.apache.camel.Predicate;
+import org.apache.camel.builder.ExpressionBuilder;
+import org.apache.camel.builder.PredicateBuilder;
+import org.apache.camel.spi.Language;
+
+/**
+ * A language for constant expressions.
+ */
+public class ConstantLanguage implements Language {
+
+    public static Expression<Exchange> constant(Object value) {        
+        return ExpressionBuilder.constantExpression(value);
+    }
+
+    public Predicate<Exchange> createPredicate(String expression) {
+        return PredicateBuilder.toPredicate(createExpression(expression));
+    }
+
+    public Expression<Exchange> createExpression(String expression) {
+        return ConstantLanguage.constant(expression);
+    }
+}

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/constant/ConstantLanguage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/constant/ConstantLanguage.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java Thu Jul 24 11:37:04 2008
@@ -1235,7 +1235,8 @@
      */
     public ExpressionClause<ProcessorType<Type>> setOutHeader(String name) {
         ExpressionClause<ProcessorType<Type>> clause = new ExpressionClause<ProcessorType<Type>>((Type) this);
-        process(ProcessorBuilder.setOutHeader(name, clause));
+        SetOutHeaderType answer = new SetOutHeaderType(name, clause);
+        addOutput(answer);
         return clause;
     }
 
@@ -1243,14 +1244,18 @@
      * Adds a processor which sets the header on the OUT message
      */
     public Type setOutHeader(String name, Expression expression) {
-        return process(ProcessorBuilder.setOutHeader(name, expression));
+        SetOutHeaderType answer = new SetOutHeaderType(name, expression);
+        addOutput(answer);
+        return (Type) this;
     }
 
     /**
-     * Adds a processor which sets the header on the OUT message
+     * Adds a processor which sets the header on the OUT message to the given value
      */
     public Type setOutHeader(String name, String value) {
-        return (Type) setOutHeader(name).constant(value);
+        SetOutHeaderType answer = new SetOutHeaderType(name, value);
+        addOutput(answer);
+        return (Type) this;
     }
 
     /**

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SetHeaderType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SetHeaderType.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SetHeaderType.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SetHeaderType.java Thu Jul 24 11:37:04 2008
@@ -24,8 +24,8 @@
 import org.apache.camel.Expression;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.ExpressionBuilder;
+import org.apache.camel.builder.ProcessorBuilder;
 import org.apache.camel.model.language.ExpressionType;
-import org.apache.camel.processor.SetHeaderProcessor;
 import org.apache.camel.spi.RouteContext;
 
 /**
@@ -36,8 +36,6 @@
 public class SetHeaderType extends ExpressionNode {
     @XmlAttribute
     private String headerName;
-    @XmlAttribute(required = false)
-    private String value;
     
     public SetHeaderType() {
     }
@@ -69,17 +67,8 @@
 
     @Override
     public Processor createProcessor(RouteContext routeContext) throws Exception {
-        Expression expr;
-
-        if (getValue() == null) {
-            expr = getExpression().createExpression(routeContext);
-        } else {
-            expr = ExpressionBuilder.constantExpression(getValue());
-        }
-
-        Processor childProcessor = routeContext.createProcessor(this);
-        
-        return new SetHeaderProcessor(getHeaderName(), expr, childProcessor);
+        Expression expr = getExpression().createExpression(routeContext);
+        return ProcessorBuilder.setHeader(getHeaderName(), expr);
     }
 
     public void setHeaderName(String headerName) {
@@ -89,12 +78,4 @@
     public String getHeaderName() {
         return headerName;
     }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    public String getValue() {
-        return value;
-    }
 }

Added: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderType.java?rev=679483&view=auto
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderType.java (added)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderType.java Thu Jul 24 11:37:04 2008
@@ -0,0 +1,81 @@
+/**
+ * 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.
+ */
+package org.apache.camel.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.camel.Expression;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.ExpressionBuilder;
+import org.apache.camel.builder.ProcessorBuilder;
+import org.apache.camel.model.language.ExpressionType;
+import org.apache.camel.spi.RouteContext;
+
+/**
+ * Represents an XML <setOutHeader/> element
+ */
+@XmlRootElement(name = "setOutHeader")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class SetOutHeaderType extends ExpressionNode {
+    @XmlAttribute
+    private String headerName;
+    
+    public SetOutHeaderType() {
+    }
+
+    public SetOutHeaderType(String headerName, ExpressionType expression) {
+        super(expression);
+        setHeaderName(headerName);
+    }
+
+    public SetOutHeaderType(String headerName, Expression expression) {
+        super(expression);
+        setHeaderName(headerName);        
+    }
+
+    public SetOutHeaderType(String headerName, String value) {
+        super(ExpressionBuilder.constantExpression(value));
+        setHeaderName(headerName);        
+    }  
+    
+    @Override
+    public String toString() {
+        return "SetOutHeader[ " + getHeaderName() + ", " + getExpression() + "]";
+    }
+
+    @Override
+    public String getShortName() {
+        return "setOutHeader";
+    }
+
+    @Override
+    public Processor createProcessor(RouteContext routeContext) throws Exception {
+        Expression expr = getExpression().createExpression(routeContext);
+        return ProcessorBuilder.setOutHeader(getHeaderName(), expr);
+    }
+
+    public void setHeaderName(String headerName) {
+        this.headerName = headerName;
+    }
+
+    public String getHeaderName() {
+        return headerName;
+    }
+}

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderType.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ConstantExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ConstantExpression.java?rev=679483&view=auto
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ConstantExpression.java (added)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ConstantExpression.java Thu Jul 24 11:37:04 2008
@@ -0,0 +1,37 @@
+/**
+ * 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.
+ */
+package org.apache.camel.model.language;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * For expressions and predicates using a constant
+ *
+ */
+@XmlRootElement(name = "constant")
+public class ConstantExpression extends ExpressionType {
+    public ConstantExpression() {
+    }
+
+    public ConstantExpression(String expression) {
+        super(expression);
+    }
+
+    public String getLanguage() {
+        return "constant";
+    }
+}

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ConstantExpression.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ConstantExpression.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ELExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ELExpression.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ELExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/ELExpression.java Thu Jul 24 11:37:04 2008
@@ -19,7 +19,7 @@
 import javax.xml.bind.annotation.XmlRootElement;
 
 /**
- * For EL expresions and predicates
+ * For EL expressions and predicates
  *
  * @version $Revision$
  */
@@ -35,4 +35,4 @@
     public String getLanguage() {
         return "el";
     }
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/GroovyExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/GroovyExpression.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/GroovyExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/GroovyExpression.java Thu Jul 24 11:37:04 2008
@@ -19,7 +19,7 @@
 import javax.xml.bind.annotation.XmlRootElement;
 
 /**
- * For Groovy expresions and predicates
+ * For Groovy expressions and predicates
  *
  * @version $Revision$
  */

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/JXPathExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/JXPathExpression.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/JXPathExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/JXPathExpression.java Thu Jul 24 11:37:04 2008
@@ -19,7 +19,7 @@
 import javax.xml.bind.annotation.XmlRootElement;
 
 /**
- * For <a href="http://commons.apache.org/jxpath/">JXPath</a> expresions and predicates
+ * For <a href="http://commons.apache.org/jxpath/">JXPath</a> expressions and predicates
  *
  * @version $Revision$
  */
@@ -35,4 +35,4 @@
     public String getLanguage() {
         return "jxpath";
     }
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/JavaScriptExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/JavaScriptExpression.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/JavaScriptExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/JavaScriptExpression.java Thu Jul 24 11:37:04 2008
@@ -19,7 +19,7 @@
 import javax.xml.bind.annotation.XmlRootElement;
 
 /**
- * For JavaScript expresions and predicates
+ * For JavaScript expressions and predicates
  *
  * @version $Revision$
  */
@@ -35,4 +35,4 @@
     public String getLanguage() {
         return "js";
     }
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/MethodCallExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/MethodCallExpression.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/MethodCallExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/MethodCallExpression.java Thu Jul 24 11:37:04 2008
@@ -28,7 +28,7 @@
 import org.apache.camel.spi.RouteContext;
 
 /**
- * For expresions and predicates using the
+ * For expressions and predicates using the
  * <a href="http://activemq.apache.org/camel/bean-language.html">bean language</a>
  *
  * @version $Revision$

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/OgnlExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/OgnlExpression.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/OgnlExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/OgnlExpression.java Thu Jul 24 11:37:04 2008
@@ -19,7 +19,7 @@
 import javax.xml.bind.annotation.XmlRootElement;
 
 /**
- * For OGNL expresions and predicates
+ * For OGNL expressions and predicates
  *
  * @version $Revision$
  */
@@ -35,4 +35,4 @@
     public String getLanguage() {
         return "ognl";
     }
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PhpExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PhpExpression.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PhpExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PhpExpression.java Thu Jul 24 11:37:04 2008
@@ -19,7 +19,7 @@
 import javax.xml.bind.annotation.XmlRootElement;
 
 /**
- * For PHP expresions and predicates
+ * For PHP expressions and predicates
  *
  * @version $Revision$
  */
@@ -35,4 +35,4 @@
     public String getLanguage() {
         return "php";
     }
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PythonExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PythonExpression.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PythonExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/PythonExpression.java Thu Jul 24 11:37:04 2008
@@ -19,7 +19,7 @@
 import javax.xml.bind.annotation.XmlRootElement;
 
 /**
- * For Python expresions and predicates
+ * For Python expressions and predicates
  *
  * @version $Revision$
  */
@@ -35,4 +35,4 @@
     public String getLanguage() {
         return "python";
     }
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/RubyExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/RubyExpression.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/RubyExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/RubyExpression.java Thu Jul 24 11:37:04 2008
@@ -19,7 +19,7 @@
 import javax.xml.bind.annotation.XmlRootElement;
 
 /**
- * For Ruby expresions and predicates
+ * For Ruby expressions and predicates
  *
  * @version $Revision$
  */
@@ -35,4 +35,4 @@
     public String getLanguage() {
         return "ruby";
     }
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SimpleExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SimpleExpression.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SimpleExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SimpleExpression.java Thu Jul 24 11:37:04 2008
@@ -19,7 +19,7 @@
 import javax.xml.bind.annotation.XmlRootElement;
 
 /**
- * For expresions and predicates using the
+ * For expressions and predicates using the
  * <a href="http://activemq.apache.org/camel/simple.html>simple language</a>
  *
  * @version $Revision$
@@ -36,4 +36,4 @@
     public String getLanguage() {
         return "simple";
     }
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SqlExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SqlExpression.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SqlExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/SqlExpression.java Thu Jul 24 11:37:04 2008
@@ -19,7 +19,7 @@
 import javax.xml.bind.annotation.XmlRootElement;
 
 /**
- * For SQL expresions and predicates
+ * For SQL expressions and predicates
  *
  * @version $Revision$
  */
@@ -35,4 +35,4 @@
     public String getLanguage() {
         return "sql";
     }
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XPathExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XPathExpression.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XPathExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XPathExpression.java Thu Jul 24 11:37:04 2008
@@ -26,7 +26,7 @@
 import org.apache.camel.spi.RouteContext;
 
 /**
- * For XPath expresions and predicates
+ * For XPath expressions and predicates
  *
  * @version $Revision$
  */

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XQueryExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XQueryExpression.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XQueryExpression.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/XQueryExpression.java Thu Jul 24 11:37:04 2008
@@ -29,7 +29,7 @@
 import org.apache.commons.logging.LogFactory;
 
 /**
- * For XQuery expresions and predicates
+ * For XQuery expressions and predicates
  *
  * @version $Revision$
  */

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/SetHeaderProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/SetHeaderProcessor.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/SetHeaderProcessor.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/SetHeaderProcessor.java Thu Jul 24 11:37:04 2008
@@ -1,59 +0,0 @@
-/**
- * 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.
- */
-package org.apache.camel.processor;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.Expression;
-import org.apache.camel.Processor;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * A processor which sets the header on the IN message
- */
-public class SetHeaderProcessor extends DelegateProcessor implements Processor {
-    private static final transient Log LOG = LogFactory.getLog(SetHeaderProcessor.class);
-    private String name;
-    private Expression expression;
-
-    public SetHeaderProcessor(String name, Expression expression) {
-        this.name = name;
-        this.expression = expression;
-    }
-
-    public SetHeaderProcessor(String name, Expression expression,
-            Processor childProcessor) {
-        super(childProcessor);
-        this.name = name;
-        this.expression = expression;
-    }
-
-    public void process(Exchange exchange) throws Exception {
-        Object value = expression.evaluate(exchange);
-        if (value == null) {
-            LOG.warn("Expression: " + expression
-                    + " on exchange: " + exchange + " evaluated to null.");
-        }
-        exchange.getIn().setHeader(name, value);
-        super.process(exchange);
-    }
-
-    @Override
-    public String toString() {
-        return "setHeader(" + name + ", " + expression + ")";
-    }
-}

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/TransformProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/TransformProcessor.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/TransformProcessor.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/TransformProcessor.java Thu Jul 24 11:37:04 2008
@@ -42,7 +42,7 @@
         Object newBody = expression.evaluate(exchange);
         exchange.getOut().setBody(newBody);
 
-        // propogate headers
+        // propagate headers
         exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders());
         
         super.process(exchange);

Added: activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/language/constant
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/language/constant?rev=679483&view=auto
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/language/constant (added)
+++ activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/language/constant Thu Jul 24 11:37:04 2008
@@ -0,0 +1,18 @@
+#
+# 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.
+#
+
+class=org.apache.camel.language.constant.ConstantLanguage

Propchange: activemq/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/language/constant
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/camel/trunk/camel-core/src/main/resources/org/apache/camel/model/jaxb.index
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/resources/org/apache/camel/model/jaxb.index?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/resources/org/apache/camel/model/jaxb.index (original)
+++ activemq/camel/trunk/camel-core/src/main/resources/org/apache/camel/model/jaxb.index Thu Jul 24 11:37:04 2008
@@ -48,6 +48,7 @@
 ServiceActivationType
 SetBodyType
 SetHeaderType
+SetOutHeaderType
 SplitterType
 ThrottlerType
 ThreadType

Modified: activemq/camel/trunk/camel-core/src/main/resources/org/apache/camel/model/language/jaxb.index
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/resources/org/apache/camel/model/language/jaxb.index?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/resources/org/apache/camel/model/language/jaxb.index (original)
+++ activemq/camel/trunk/camel-core/src/main/resources/org/apache/camel/model/language/jaxb.index Thu Jul 24 11:37:04 2008
@@ -14,6 +14,7 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## ------------------------------------------------------------------------
+ConstantExpression
 ELExpression
 ExpressionType
 GroovyExpression
@@ -29,4 +30,4 @@
 SimpleExpression
 SqlExpression
 XPathExpression
-XQueryExpression
\ No newline at end of file
+XQueryExpression

Added: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/language/ConstantTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/language/ConstantTest.java?rev=679483&view=auto
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/language/ConstantTest.java (added)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/language/ConstantTest.java Thu Jul 24 11:37:04 2008
@@ -0,0 +1,36 @@
+/**
+ * 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.
+ */
+package org.apache.camel.language;
+
+import org.apache.camel.LanguageTestSupport;
+
+public class ConstantTest extends LanguageTestSupport {
+
+    public void testSimpleExpressions() throws Exception {
+        // We can put anything in here, the expression will
+        // always evaluate to itself
+        assertExpression("a value", "a value");
+    }
+
+    public void testPredicates() throws Exception {
+        assertPredicate("another value");
+    }
+
+    protected String getLanguageName() {
+        return "constant";
+    }
+}

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/language/ConstantTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/language/ConstantTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/model/XmlParseTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/model/XmlParseTest.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/model/XmlParseTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/model/XmlParseTest.java Thu Jul 24 11:37:04 2008
@@ -106,25 +106,33 @@
         assertChildTo(route, "mock:b", 1);
     }  
 
-    public void testParseSetHeaderWithChildProcessorXml() throws Exception {
-        RouteType route = assertOneRoute("setHeaderWithChildProcessor.xml");
-        assertFrom(route, "seda:a");
-        SetHeaderType node = assertSetHeader(route);
-        assertEquals("oldBodyValue", node.getHeaderName());
-        assertExpression(node.getExpression(), "simple", "body");
-        assertChildTo(node, "mock:b");
-    }
-
     public void testParseSetHeaderToConstantXml() throws Exception {
         RouteType route = assertOneRoute("setHeaderToConstant.xml");
         assertFrom(route, "seda:a");
         SetHeaderType node = assertSetHeader(route);
         assertEquals("theHeader", node.getHeaderName());
-        assertEquals("a value", node.getValue());
-        assertEquals("", node.getExpression().getExpression());
+        assertExpression(node.getExpression(), "constant", "a value");
         assertChildTo(route, "mock:b", 1);
     }      
 
+    public void testParseSetOutHeaderXml() throws Exception {
+        RouteType route = assertOneRoute("setOutHeader.xml");
+        assertFrom(route, "seda:a");
+        SetOutHeaderType node = assertSetOutHeader(route);
+        assertEquals("oldBodyValue", node.getHeaderName());
+        assertExpression(node.getExpression(), "simple", "body");
+        assertChildTo(route, "mock:b", 1);
+    }  
+
+    public void testParseSetOutHeaderToConstantXml() throws Exception {
+        RouteType route = assertOneRoute("setOutHeaderToConstant.xml");
+        assertFrom(route, "seda:a");
+        SetOutHeaderType node = assertSetOutHeader(route);
+        assertEquals("theHeader", node.getHeaderName());
+        assertExpression(node.getExpression(), "constant", "a value");
+        assertChildTo(route, "mock:b", 1);
+    }        
+    
     public void testParseConvertBodyXml() throws Exception {
         RouteType route = assertOneRoute("convertBody.xml");
         assertFrom(route, "seda:a");
@@ -297,6 +305,11 @@
         return assertIsInstanceOf(SetHeaderType.class, processor);
     }    
 
+    protected SetOutHeaderType assertSetOutHeader(ProcessorType<?> route) {
+        ProcessorType<?> processor = route.getOutputs().get(0);
+        return assertIsInstanceOf(SetOutHeaderType.class, processor);
+    }  
+    
     protected TransformType assertTransform(ProcessorType<?> route) {
         ProcessorType<?> processor = route.getOutputs().get(0);
         return assertIsInstanceOf(TransformType.class, processor);

Modified: activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setHeaderToConstant.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setHeaderToConstant.xml?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setHeaderToConstant.xml (original)
+++ activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setHeaderToConstant.xml Thu Jul 24 11:37:04 2008
@@ -18,8 +18,8 @@
 <routes id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
   <route>
     <from uri="seda:a"/>
-    <setHeader headerName="theHeader" value="a value">
-      <expression/>
+    <setHeader headerName="theHeader">
+      <constant>a value</constant>
     </setHeader>
     <to uri="mock:b"/>
   </route>

Modified: activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setHeaderWithChildProcessor.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setHeaderWithChildProcessor.xml?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setHeaderWithChildProcessor.xml (original)
+++ activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setHeaderWithChildProcessor.xml Thu Jul 24 11:37:04 2008
@@ -1,26 +0,0 @@
-<?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.
--->
-<routes id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
-  <route>
-    <from uri="seda:a"/>
-    <setHeader headerName="oldBodyValue">
-      <simple>body</simple>
-      <to uri="mock:b"/>    
-    </setHeader>
-  </route>
-</routes>

Added: activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setOutHeader.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setOutHeader.xml?rev=679483&view=auto
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setOutHeader.xml (added)
+++ activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setOutHeader.xml Thu Jul 24 11:37:04 2008
@@ -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.
+-->
+<routes id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
+  <route>
+    <from uri="seda:a"/>
+    <setOutHeader headerName="oldBodyValue">
+      <simple>body</simple>
+    </setOutHeader>
+    <to uri="mock:b"/>    
+  </route>
+</routes>

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

Propchange: activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setOutHeader.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setOutHeader.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setOutHeaderToConstant.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setOutHeaderToConstant.xml?rev=679483&view=auto
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setOutHeaderToConstant.xml (added)
+++ activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setOutHeaderToConstant.xml Thu Jul 24 11:37:04 2008
@@ -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.
+-->
+<routes id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
+  <route>
+    <from uri="seda:a"/>
+    <setOutHeader headerName="theHeader">
+      <constant>a value</constant>
+    </setOutHeader>
+    <to uri="mock:b"/>
+  </route>
+</routes>

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

Propchange: activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setOutHeaderToConstant.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/model/setOutHeaderToConstant.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringSetHeaderWithChildProcessorTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringSetHeaderWithChildProcessorTest.java?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringSetHeaderWithChildProcessorTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringSetHeaderWithChildProcessorTest.java Thu Jul 24 11:37:04 2008
@@ -1,40 +0,0 @@
-/**
- * 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.
- */
-package org.apache.camel.spring.processor;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.component.mock.MockEndpoint;
-
-import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
-
-public class SpringSetHeaderWithChildProcessorTest extends ContextTestSupport {
-    
-    public void testSetHeaderWithExpression() throws Exception {
-        MockEndpoint resultEndpoint = getMockEndpoint("mock:b");
-        resultEndpoint.expectedBodiesReceived("Hello");
-        resultEndpoint.expectedHeaderReceived("oldBodyValue", "Hello");
-
-        sendBody("seda:a", "Hello");
-
-        resultEndpoint.assertIsSatisfied();
-    }
-
-    protected CamelContext createCamelContext() throws Exception {
-        return createSpringCamelContext(this, "org/apache/camel/spring/processor/SpringSetHeaderTestWithChildProcessor-context.xml");
-    }
-}

Added: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringSetOutHeaderTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringSetOutHeaderTest.java?rev=679483&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringSetOutHeaderTest.java (added)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringSetOutHeaderTest.java Thu Jul 24 11:37:04 2008
@@ -0,0 +1,39 @@
+/**
+ * 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.
+ */
+package org.apache.camel.spring.processor;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.component.mock.MockEndpoint;
+
+import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
+
+public class SpringSetOutHeaderTest extends ContextTestSupport {
+    
+    public void testSetOutHeaderWithExpression() throws Exception {
+        MockEndpoint resultEndpoint = getMockEndpoint("mock:b");
+        resultEndpoint.expectedHeaderReceived("oldBodyValue", "Hello");
+        resultEndpoint.expectedMinimumMessageCount(1);
+
+        sendBody("seda:a", "Hello");
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    protected CamelContext createCamelContext() throws Exception {
+        return createSpringCamelContext(this, "org/apache/camel/spring/processor/setOutHeader.xml");
+    }
+}

Added: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringSetOutHeaderWithConstantTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringSetOutHeaderWithConstantTest.java?rev=679483&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringSetOutHeaderWithConstantTest.java (added)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringSetOutHeaderWithConstantTest.java Thu Jul 24 11:37:04 2008
@@ -0,0 +1,39 @@
+/**
+ * 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.
+ */
+package org.apache.camel.spring.processor;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.component.mock.MockEndpoint;
+
+import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
+
+public class SpringSetOutHeaderWithConstantTest extends ContextTestSupport {
+    
+    public void testSetOutHeaderWithExpression() throws Exception {
+        MockEndpoint resultEndpoint = getMockEndpoint("mock:b");
+        resultEndpoint.expectedHeaderReceived("theHeader", "the value");
+        resultEndpoint.expectedMinimumMessageCount(1);
+
+        sendBody("seda:a", "Hello");
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    protected CamelContext createCamelContext() throws Exception {
+        return createSpringCamelContext(this, "org/apache/camel/spring/processor/setOutHeaderWithConstant.xml");
+    }
+}

Modified: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringSetHeaderTestWithChildProcessor-context.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringSetHeaderTestWithChildProcessor-context.xml?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringSetHeaderTestWithChildProcessor-context.xml (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringSetHeaderTestWithChildProcessor-context.xml Thu Jul 24 11:37:04 2008
@@ -1,36 +0,0 @@
-<?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.
--->
-<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.5.xsd
-       http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
-    ">
-
-  <!-- START SNIPPET: example -->
-  <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
-    <route>
-      <from uri="seda:a"/>
-      <setHeader headerName="oldBodyValue">
-        <simple>body</simple>
-        <to uri="mock:b"/>    
-      </setHeader>
-    </route>
-  </camelContext>
-  <!-- END SNIPPET: example -->
-</beans>

Modified: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringSetHeaderWithConstantTest-context.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringSetHeaderWithConstantTest-context.xml?rev=679483&r1=679482&r2=679483&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringSetHeaderWithConstantTest-context.xml (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringSetHeaderWithConstantTest-context.xml Thu Jul 24 11:37:04 2008
@@ -26,8 +26,8 @@
   <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
     <route>
       <from uri="seda:a"/>
-      <setHeader headerName="theHeader" value="the value">
-        <expression/>        
+      <setHeader headerName="theHeader">
+        <constant>the value</constant>        
       </setHeader>
       <to uri="mock:b"/>    
     </route>

Added: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/setOutHeader.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/setOutHeader.xml?rev=679483&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/setOutHeader.xml (added)
+++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/setOutHeader.xml Thu Jul 24 11:37:04 2008
@@ -0,0 +1,36 @@
+<?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.
+-->
+<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.5.xsd
+       http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
+    ">
+
+  <!-- START SNIPPET: example -->
+  <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
+    <route>
+      <from uri="seda:a"/>
+      <setOutHeader headerName="oldBodyValue">
+        <simple>body</simple>
+      </setOutHeader>
+      <to uri="mock:b"/>    
+    </route>
+  </camelContext>
+  <!-- END SNIPPET: example -->
+</beans>

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

Propchange: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/setOutHeader.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/setOutHeader.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/setOutHeaderWithConstant.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/setOutHeaderWithConstant.xml?rev=679483&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/setOutHeaderWithConstant.xml (added)
+++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/setOutHeaderWithConstant.xml Thu Jul 24 11:37:04 2008
@@ -0,0 +1,36 @@
+<?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.
+-->
+<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.5.xsd
+       http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
+    ">
+
+  <!-- START SNIPPET: example -->
+  <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
+    <route>
+      <from uri="seda:a"/>
+      <setOutHeader headerName="theHeader">
+        <constant>the value</constant>
+      </setOutHeader>
+      <to uri="mock:b"/>    
+    </route>
+  </camelContext>
+  <!-- END SNIPPET: example -->
+</beans>

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

Propchange: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/setOutHeaderWithConstant.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/setOutHeaderWithConstant.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml


LightInTheBox - Buy quality products at wholesale price