RE: svn commit: r689024 - in /activemq/camel/trunk/camel-core/src: main/java/org/apache/camel/builder/ProcessorBuilder.java test/java/org/apache/camel/processor/AggregatorTest.java

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: svn commit: r689024 - in /activemq/camel/trunk/camel-core/src: main/java/org/apache/camel/builder/ProcessorBuilder.java test/java/org/apache/camel/processor/AggregatorTest.java

Claus Ibsen
Hi Willem

There is a System.out in the src/main java code ;)

Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: 26. august 2008 12:36
To: [hidden email]
Subject: svn commit: r689024 - in /activemq/camel/trunk/camel-core/src: main/java/org/apache/camel/builder/ProcessorBuilder.java test/java/org/apache/camel/processor/AggregatorTest.java

Author: ningjiang
Date: Tue Aug 26 03:36:13 2008
New Revision: 689024

URL: http://svn.apache.org/viewvc?rev=689024&view=rev
Log:
CAMEL-393 Enable the test

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ProcessorBuilder.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/AggregatorTest.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ProcessorBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ProcessorBuilder.java?rev=689024&r1=689023&r2=689024&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ProcessorBuilder.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ProcessorBuilder.java Tue Aug 26 03:36:13 2008
@@ -91,6 +91,7 @@
     public static Processor setHeader(final String name, final Expression expression) {
         return new Processor() {
             public void process(Exchange exchange) {
+                System.out.println("Calling the setHeader");
                 Object value = expression.evaluate(exchange);
                 exchange.getIn().setHeader(name, value);
             }
@@ -219,7 +220,7 @@
             }
         };
     }
-    
+
     /**
      * Throws an exception
      */

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/AggregatorTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/AggregatorTest.java?rev=689024&r1=689023&r2=689024&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/AggregatorTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/AggregatorTest.java Tue Aug 26 03:36:13 2008
@@ -17,6 +17,8 @@
 package org.apache.camel.processor;
 
 import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 
@@ -69,8 +71,8 @@
         resultEndpoint.assertIsSatisfied();
     }
 
-    //TODO fix this test
-    public void xtestAggregatorNotAtStart() throws Exception {
+
+    public void testAggregatorNotAtStart() throws Exception {
         MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
         resultEndpoint.expectedMessageCount(1);
         resultEndpoint.message(0).header("visited").isNotNull();
@@ -85,10 +87,13 @@
                 // START SNIPPET: ex
                 from("direct:start").aggregator(header("cheese")).to("mock:result");
 
-                from("seda:header").setHeader("visited", constant(true)).aggregator(header("cheese")).to("mock:result");
+                //from("seda:header").setHeader("visited", constant(true)).aggregator(header("cheese")).to("mock:result");
+                from("seda:header").setHeader("visited", constant(true)).to("direct:temp");
+
+                from("direct:temp").aggregator(header("cheese")).to("mock:result");
 
                 from("direct:predicate").aggregator(header("cheese"), new MyAggregationStrategy()).
-                        completedPredicate(header("aggregated").isEqualTo(5)).to("mock:result");
+                    completedPredicate(header("aggregated").isEqualTo(5)).to("mock:result");
                 // END SNIPPET: ex
             }
         };


Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r689024 - in /activemq/camel/trunk/camel-core/src: main/java/org/apache/camel/builder/ProcessorBuilder.java test/java/org/apache/camel/processor/AggregatorTest.java

Willem.Jiang
Administrator
Hi Claus,

I just found that after I entered the commit button.
I did a quick fix for that and thanks for pointing it out.

Willem
Claus Ibsen wrote:

> Hi Willem
>
> There is a System.out in the src/main java code ;)
>
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> Sent: 26. august 2008 12:36
> To: [hidden email]
> Subject: svn commit: r689024 - in /activemq/camel/trunk/camel-core/src: main/java/org/apache/camel/builder/ProcessorBuilder.java test/java/org/apache/camel/processor/AggregatorTest.java
>
> Author: ningjiang
> Date: Tue Aug 26 03:36:13 2008
> New Revision: 689024
>
> URL: http://svn.apache.org/viewvc?rev=689024&view=rev
> Log:
> CAMEL-393 Enable the test
>
> Modified:
>     activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ProcessorBuilder.java
>     activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/AggregatorTest.java
>
> Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ProcessorBuilder.java
> URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ProcessorBuilder.java?rev=689024&r1=689023&r2=689024&view=diff
> ==============================================================================
> --- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ProcessorBuilder.java (original)
> +++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ProcessorBuilder.java Tue Aug 26 03:36:13 2008
> @@ -91,6 +91,7 @@
>      public static Processor setHeader(final String name, final Expression expression) {
>          return new Processor() {
>              public void process(Exchange exchange) {
> +                System.out.println("Calling the setHeader");
>                  Object value = expression.evaluate(exchange);
>                  exchange.getIn().setHeader(name, value);
>              }
> @@ -219,7 +220,7 @@
>              }
>          };
>      }
> -    
> +
>      /**
>       * Throws an exception
>       */
>
> Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/AggregatorTest.java
> URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/AggregatorTest.java?rev=689024&r1=689023&r2=689024&view=diff
> ==============================================================================
> --- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/AggregatorTest.java (original)
> +++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/AggregatorTest.java Tue Aug 26 03:36:13 2008
> @@ -17,6 +17,8 @@
>  package org.apache.camel.processor;
>  
>  import org.apache.camel.ContextTestSupport;
> +import org.apache.camel.Exchange;
> +import org.apache.camel.Processor;
>  import org.apache.camel.builder.RouteBuilder;
>  import org.apache.camel.component.mock.MockEndpoint;
>  
> @@ -69,8 +71,8 @@
>          resultEndpoint.assertIsSatisfied();
>      }
>  
> -    //TODO fix this test
> -    public void xtestAggregatorNotAtStart() throws Exception {
> +
> +    public void testAggregatorNotAtStart() throws Exception {
>          MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
>          resultEndpoint.expectedMessageCount(1);
>          resultEndpoint.message(0).header("visited").isNotNull();
> @@ -85,10 +87,13 @@
>                  // START SNIPPET: ex
>                  from("direct:start").aggregator(header("cheese")).to("mock:result");
>  
> -                from("seda:header").setHeader("visited", constant(true)).aggregator(header("cheese")).to("mock:result");
> +                //from("seda:header").setHeader("visited", constant(true)).aggregator(header("cheese")).to("mock:result");
> +                from("seda:header").setHeader("visited", constant(true)).to("direct:temp");
> +
> +                from("direct:temp").aggregator(header("cheese")).to("mock:result");
>  
>                  from("direct:predicate").aggregator(header("cheese"), new MyAggregationStrategy()).
> -                        completedPredicate(header("aggregated").isEqualTo(5)).to("mock:result");
> +                    completedPredicate(header("aggregated").isEqualTo(5)).to("mock:result");
>                  // END SNIPPET: ex
>              }
>          };
>
>
>
>