camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r605931 - in /activemq/camel/trunk/camel-core/src: main/java/org/apache/camel/model/DelayerType.java main/java/org/apache/camel/model/ExpressionNode.java test/java/org/apache/camel/processor/DelayerTest.java
Date Thu, 20 Dec 2007 13:50:40 GMT
Author: gnodet
Date: Thu Dec 20 05:50:38 2007
New Revision: 605931

URL: http://svn.apache.org/viewvc?rev=605931&view=rev
Log:
CAMEL-273: delayer(3000) throws an exception

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/DelayerType.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ExpressionNode.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DelayerTest.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/DelayerType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/DelayerType.java?rev=605931&r1=605930&r2=605931&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/DelayerType.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/DelayerType.java
Thu Dec 20 05:50:38 2007
@@ -66,7 +66,7 @@
     @Override
     public Processor createProcessor(RouteContext routeContext) throws Exception {
         Processor childProcessor = routeContext.createProcessor(this);
-        Expression processAtExpression = getExpression().createExpression(routeContext);
+        Expression processAtExpression = getExpression() != null ? getExpression().createExpression(routeContext)
: null;
         return new Delayer(childProcessor, processAtExpression, delay);
     }
 }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ExpressionNode.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ExpressionNode.java?rev=605931&r1=605930&r2=605931&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ExpressionNode.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ExpressionNode.java
Thu Dec 20 05:50:38 2007
@@ -51,11 +51,15 @@
     }
 
     public ExpressionNode(Expression expression) {
-        setExpression(new ExpressionType(expression));
+        if (expression != null) {
+            setExpression(new ExpressionType(expression));
+        }
     }
 
     public ExpressionNode(Predicate predicate) {
-        setExpression(new ExpressionType(predicate));
+        if (predicate != null) {
+            setExpression(new ExpressionType(predicate));
+        }
     }
 
     public ExpressionType getExpression() {

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DelayerTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DelayerTest.java?rev=605931&r1=605930&r2=605931&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DelayerTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DelayerTest.java
Thu Dec 20 05:50:38 2007
@@ -36,6 +36,13 @@
         // now if we wait a bit longer we should receive the message!
         resultEndpoint.expectedMessageCount(1);
         resultEndpoint.assertIsSatisfied();
+
+        template.sendBody("seda:b", "<hello>world!</hello>");
+        resultEndpoint.assertIsSatisfied();
+
+        // now if we wait a bit longer we should receive the message!
+        resultEndpoint.expectedMessageCount(1);
+        resultEndpoint.assertIsSatisfied();
     }
 
     @Override
@@ -50,6 +57,9 @@
                 // START SNIPPET: ex
                 from("seda:a").delayer(header("JMSTimestamp"), 3000).to("mock:result");
                 // END SNIPPET: ex
+                // START SNIPPET: ex2
+                from("seda:b").delayer(3000).to("mock:result");
+                // END SNIPPET: ex2
             }
         };
     }



Mime
View raw message