camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmuel...@apache.org
Subject svn commit: r1293027 - in /camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity: VelocityMethodInvokationTest.java VelocityTest.java
Date Thu, 23 Feb 2012 23:20:37 GMT
Author: cmueller
Date: Thu Feb 23 23:20:36 2012
New Revision: 1293027

URL: http://svn.apache.org/viewvc?rev=1293027&view=rev
Log:
add unit test for an user forum issue

Added:
    camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityMethodInvokationTest.java
      - copied, changed from r1293022, camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityTest.java
Modified:
    camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityTest.java

Copied: camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityMethodInvokationTest.java
(from r1293022, camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityMethodInvokationTest.java?p2=camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityMethodInvokationTest.java&p1=camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityTest.java&r1=1293022&r2=1293027&rev=1293027&view=diff
==============================================================================
--- camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityTest.java
(original)
+++ camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityMethodInvokationTest.java
Thu Feb 23 23:20:36 2012
@@ -25,7 +25,7 @@ import org.apache.camel.test.junit4.Came
 import org.apache.velocity.tools.generic.EscapeTool;
 import org.junit.Test;
 
-public class VelocityTest extends CamelTestSupport {
+public class VelocityMethodInvokationTest extends CamelTestSupport {
     
     @Test
     public void testVelocityLetter() throws Exception {

Modified: camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityTest.java?rev=1293027&r1=1293026&r2=1293027&view=diff
==============================================================================
--- camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityTest.java
(original)
+++ camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityTest.java
Thu Feb 23 23:20:36 2012
@@ -22,7 +22,6 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.apache.velocity.tools.generic.EscapeTool;
 import org.junit.Test;
 
 public class VelocityTest extends CamelTestSupport {
@@ -34,13 +33,13 @@ public class VelocityTest extends CamelT
             @Override
             public void process(Exchange exchange) throws Exception {
                 exchange.getIn().addAttachment("item", dataHandler);
-                exchange.getIn().setBody("Monday & Tuesday");
+                exchange.getIn().setBody("Monday");
                 exchange.getIn().setHeader("name", "Christian");
                 exchange.setProperty("item", "7");
             }
         });
 
-        assertEquals("Dear Christian. You ordered item 7 on Monday & Tuesday.", exchange.getOut().getBody());
+        assertEquals("Dear Christian. You ordered item 7 on Monday.", exchange.getOut().getBody());
         assertEquals("Christian", exchange.getOut().getHeader("name"));
         assertSame(dataHandler, exchange.getOut().getAttachment("item"));
     }
@@ -48,9 +47,10 @@ public class VelocityTest extends CamelT
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
-                from("direct:a")
-                    .setHeader("esc", constant(new EscapeTool()))
-                    .to("velocity:org/apache/camel/component/velocity/escape.vm");
+                // START SNIPPET: example
+                from("direct:a").
+                        to("velocity:org/apache/camel/component/velocity/example.vm");
+                // END SNIPPET: example
             }
         };
     }



Mime
View raw message