camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r679864 - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/model/ camel-core/src/test/java/org/apache/camel/builder/ camel-core/src/test/java/org/apache/camel/component/bean/ camel-core/src/test/java/org/apache/camel/comp...
Date Fri, 25 Jul 2008 17:30:08 GMT
Author: davsclaus
Date: Fri Jul 25 10:30:08 2008
New Revision: 679864

URL: http://svn.apache.org/viewvc?rev=679864&view=rev
Log:
CAMEL-746: Applied patch no 3 with thanks to Jonathan

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/SetOutHeaderType.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExceptionBuilderTest.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithAnnotationAndExchangeTest.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithHeaderTest.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/BeanToFileTest.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FilerProducerFileNamesTest.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/management/CamelChoiceWithManagementTest.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SetHeaderUsingDslExpressionsTest.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/exceptionpolicy/CustomExceptionPolicyStrategyTest.java
    activemq/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpToFileTest.java
    activemq/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSubjectTest.java

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=679864&r1=679863&r2=679864&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
Fri Jul 25 10:30:08 2008
@@ -1223,6 +1223,7 @@
 
     /**
      * Adds a processor which sets the header on the IN message to the given value
+     * @deprecated Please use {@link #setHeader(String, Expression)} instead. Will be removed
in Camel 2.0.
      */
     public Type setHeader(String name, String value) {
         SetHeaderType answer = new SetHeaderType(name, value);
@@ -1250,15 +1251,6 @@
     }
 
     /**
-     * Adds a processor which sets the header on the OUT message to the given value
-     */
-    public Type setOutHeader(String name, String value) {
-        SetOutHeaderType answer = new SetOutHeaderType(name, value);
-        addOutput(answer);
-        return (Type) this;
-    }
-
-    /**
      * Adds a processor which sets the header on the FAULT message
      */
     public Type setFaultHeader(String name, Expression expression) {

Modified: 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=679864&r1=679863&r2=679864&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderType.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SetOutHeaderType.java
Fri Jul 25 10:30:08 2008
@@ -23,7 +23,6 @@
 
 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;
@@ -50,11 +49,6 @@
         setHeaderName(headerName);        
     }
 
-    public SetOutHeaderType(String headerName, String value) {
-        super(ExpressionBuilder.constantExpression(value));
-        setHeaderName(headerName);        
-    }   
-    
     @Override
     public String toString() {
         return "SetOutHeader[ " + getHeaderName() + ", " + getExpression() + "]";

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExceptionBuilderTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExceptionBuilderTest.java?rev=679864&r1=679863&r2=679864&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExceptionBuilderTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExceptionBuilderTest.java
Fri Jul 25 10:30:08 2008
@@ -101,7 +101,7 @@
                 // START SNIPPET: exceptionBuilder1
                 exception(NullPointerException.class)
                     .maximumRedeliveries(1)
-                    .setHeader(MESSAGE_INFO, "Damm a NPE")
+                    .setHeader(MESSAGE_INFO, constant("Damm a NPE"))
                     .to(ERROR_QUEUE);
 
                 exception(IOException.class)
@@ -109,25 +109,25 @@
                     .maximumRedeliveries(3)
                     .backOffMultiplier(1.0)
                     .useExponentialBackOff()
-                    .setHeader(MESSAGE_INFO, "Damm somekind of IO exception")
+                    .setHeader(MESSAGE_INFO, constant("Damm somekind of IO exception"))
                     .to(ERROR_QUEUE);
 
                 exception(Exception.class)
                     .initialRedeliveryDelay(1000L)
                     .maximumRedeliveries(2)
-                    .setHeader(MESSAGE_INFO, "Damm just exception")
+                    .setHeader(MESSAGE_INFO, constant("Damm just exception"))
                     .to(ERROR_QUEUE);
                 // END SNIPPET: exceptionBuilder1
 
                 exception(MyBaseBusinessException.class)
                     .initialRedeliveryDelay(1000L)
                     .maximumRedeliveries(3)
-                    .setHeader(MESSAGE_INFO, "Damm my business is not going to well")
+                    .setHeader(MESSAGE_INFO, constant("Damm my business is not going to well"))
                     .to(BUSINESS_ERROR_QUEUE);
 
                 exception(GeneralSecurityException.class).exception(KeyException.class)
                     .maximumRedeliveries(1)
-                    .setHeader(MESSAGE_INFO, "Damm some security error")
+                    .setHeader(MESSAGE_INFO, constant("Damm some security error"))
                     .to(SECURITY_ERROR_QUEUE);
 
 
@@ -154,3 +154,4 @@
 
 }
 
+

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithAnnotationAndExchangeTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithAnnotationAndExchangeTest.java?rev=679864&r1=679863&r2=679864&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithAnnotationAndExchangeTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithAnnotationAndExchangeTest.java
Fri Jul 25 10:30:08 2008
@@ -52,7 +52,7 @@
         return new RouteBuilder() {
             public void configure() throws Exception {
                 from("direct:in")
-                    .setHeader("user", "admin")
+                    .setHeader("user", constant("admin"))
                     .to("bean:myBean")
                     .to("mock:result");
             }
@@ -70,4 +70,4 @@
         // END SNIPPET: e1
     }
 
-}
\ No newline at end of file
+}

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithHeaderTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithHeaderTest.java?rev=679864&r1=679863&r2=679864&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithHeaderTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithHeaderTest.java
Fri Jul 25 10:30:08 2008
@@ -50,7 +50,7 @@
         return new RouteBuilder() {
             public void configure() throws Exception {
                 from("direct:in")
-                    .setHeader("foo", "bar")
+                    .setHeader("foo", constant("bar"))
                     .to("bean:myBean")
                     .to("seda:a");
 

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/BeanToFileTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/BeanToFileTest.java?rev=679864&r1=679863&r2=679864&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/BeanToFileTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/BeanToFileTest.java
Fri Jul 25 10:30:08 2008
@@ -52,7 +52,7 @@
             public void configure() throws Exception {
                 from("direct:in").
                     to("bean:myBean").
-                    setHeader(FileComponent.HEADER_FILE_NAME, "BeanToFileTest.txt").
+                    setHeader(FileComponent.HEADER_FILE_NAME, constant("BeanToFileTest.txt")).
                     to("file://target/?append=false");
             }
         };

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FilerProducerFileNamesTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FilerProducerFileNamesTest.java?rev=679864&r1=679863&r2=679864&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FilerProducerFileNamesTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FilerProducerFileNamesTest.java
Fri Jul 25 10:30:08 2008
@@ -24,7 +24,7 @@
 import org.apache.camel.builder.RouteBuilder;
 
 /**
- * Unit test for the how FileProducer behaves a bit strantegly when generating filenames
+ * Unit test for the how FileProducer behaves a bit strangely when generating filenames
  */
 public class FilerProducerFileNamesTest extends ContextTestSupport {
 
@@ -62,7 +62,7 @@
 
                 from("direct:report2").to("file:target/report2.txt?autoCreate=false");
 
-                from("direct:report3").setHeader(FileComponent.HEADER_FILE_NAME, "report-super.txt").to("file:target/");
+                from("direct:report3").setHeader(FileComponent.HEADER_FILE_NAME, constant("report-super.txt")).to("file:target/");
             }
         };
     }

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/management/CamelChoiceWithManagementTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/management/CamelChoiceWithManagementTest.java?rev=679864&r1=679863&r2=679864&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/management/CamelChoiceWithManagementTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/management/CamelChoiceWithManagementTest.java
Fri Jul 25 10:30:08 2008
@@ -97,7 +97,7 @@
             public void configure() {
                 from("direct:start")
                     .choice()
-                        .when(header("CBR1").isEqualTo("Yes")).to("mock:a").setHeader("Validation",
"Yes")
+                        .when(header("CBR1").isEqualTo("Yes")).to("mock:a").setHeader("Validation",
constant("Yes"))
                         .when(header("CBR1").isEqualTo("No")).to("mock:b").end()
                     .choice().when(header("Validation").isEqualTo("Yes")).to("mock:c")
                         .when(header("Validation").isEqualTo("No")).to("mock:d").otherwise().to("mock:e").end();

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SetHeaderUsingDslExpressionsTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SetHeaderUsingDslExpressionsTest.java?rev=679864&r1=679863&r2=679864&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SetHeaderUsingDslExpressionsTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SetHeaderUsingDslExpressionsTest.java
Fri Jul 25 10:30:08 2008
@@ -46,7 +46,7 @@
         context.addRoutes(new RouteBuilder() {
             public void configure() throws Exception {
                 from("direct:start").
-                        setHeader("foo", "ABC").
+                        setHeader("foo", constant("ABC")).
                         to("mock:result");
             }
         });

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/exceptionpolicy/CustomExceptionPolicyStrategyTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/exceptionpolicy/CustomExceptionPolicyStrategyTest.java?rev=679864&r1=679863&r2=679864&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/exceptionpolicy/CustomExceptionPolicyStrategyTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/exceptionpolicy/CustomExceptionPolicyStrategyTest.java
Fri Jul 25 10:30:08 2008
@@ -70,12 +70,12 @@
 
                 exception(MyPolicyException.class)
                     .maximumRedeliveries(1)
-                    .setHeader(MESSAGE_INFO, "Damm my policy exception")
+                    .setHeader(MESSAGE_INFO, constant("Damm my policy exception"))
                     .to(ERROR_QUEUE);
 
                 exception(CamelException.class)
                     .maximumRedeliveries(3)
-                    .setHeader(MESSAGE_INFO, "Damm a Camel exception")
+                    .setHeader(MESSAGE_INFO, constant("Damm a Camel exception"))
                     .to(ERROR_QUEUE);
                 // END SNIPPET e1
 

Modified: activemq/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpToFileTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpToFileTest.java?rev=679864&r1=679863&r2=679864&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpToFileTest.java
(original)
+++ activemq/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpToFileTest.java
Fri Jul 25 10:30:08 2008
@@ -62,7 +62,7 @@
 
                 // store the content from the queue as a file
                 from("seda:in").process(new MyJettyProcessor())
-                    .setHeader(FileComponent.HEADER_FILE_NAME, "hello.txt")
+                    .setHeader(FileComponent.HEADER_FILE_NAME, constant("hello.txt"))
                     .to("file://target/myworld?append=false");
             }
         };

Modified: activemq/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSubjectTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSubjectTest.java?rev=679864&r1=679863&r2=679864&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSubjectTest.java
(original)
+++ activemq/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSubjectTest.java
Fri Jul 25 10:30:08 2008
@@ -41,7 +41,7 @@
         return new RouteBuilder() {
             public void configure() throws Exception {
                 // START SNIPPET: e1
-                from("direct:a").setHeader("subject", subject).to("smtp://james2@localhost");
+                from("direct:a").setHeader("subject", constant(subject)).to("smtp://james2@localhost");
                 // END SNIPPET: e1
 
                 from("pop3://localhost?username=james2&password=secret&consumer.delay=1000").to("mock:result");



Mime
View raw message