camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject svn commit: r1164170 - in /camel/trunk/camel-core/src/test/java/org/apache/camel/component/language: LanguageRouteConvertBodyTest.java LanguageRouteNoTransformTest.java LanguageRouteTest.java LanguageScriptInHeaderRouteTakePrecedenceTest.java
Date Thu, 01 Sep 2011 17:03:10 GMT
Author: hadrian
Date: Thu Sep  1 17:03:10 2011
New Revision: 1164170

URL: http://svn.apache.org/viewvc?rev=1164170&view=rev
Log:
CAMEL-4394. A few other tests with invalid URI encoding (language component)

Modified:
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageRouteConvertBodyTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageRouteNoTransformTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageRouteTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageScriptInHeaderRouteTakePrecedenceTest.java

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageRouteConvertBodyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageRouteConvertBodyTest.java?rev=1164170&r1=1164169&r2=1164170&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageRouteConvertBodyTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageRouteConvertBodyTest.java
Thu Sep  1 17:03:10 2011
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.language;
 
+import java.net.URLEncoder;
+
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.builder.RouteBuilder;
 
@@ -38,7 +40,8 @@ public class LanguageRouteConvertBodyTes
             @Override
             public void configure() throws Exception {
                 // START SNIPPET: e1
-                from("direct:start").to("language:simple:${mandatoryBodyAs(String)}").to("mock:result");
+                String script = URLEncoder.encode("${mandatoryBodyAs(String)}", "UTF-8");
+                from("direct:start").to("language:simple:" + script).to("mock:result");
                 // END SNIPPET: e1
             }
         };

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageRouteNoTransformTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageRouteNoTransformTest.java?rev=1164170&r1=1164169&r2=1164170&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageRouteNoTransformTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageRouteNoTransformTest.java
Thu Sep  1 17:03:10 2011
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.language;
 
+import java.net.URLEncoder;
+
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.builder.RouteBuilder;
 
@@ -37,7 +39,10 @@ public class LanguageRouteNoTransformTes
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("language:simple:Hello+${body}?transform=false").to("mock:result");
+                String script = URLEncoder.encode("Hello ${body}", "UTF-8");
+                from("direct:start")
+                    .to("language:simple:" + script + "?transform=false")
+                    .to("mock:result");
             }
         };
     }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageRouteTest.java?rev=1164170&r1=1164169&r2=1164170&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageRouteTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageRouteTest.java
Thu Sep  1 17:03:10 2011
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.language;
 
+import java.net.URLEncoder;
+
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.builder.RouteBuilder;
 
@@ -38,7 +40,8 @@ public class LanguageRouteTest extends C
             @Override
             public void configure() throws Exception {
                 // START SNIPPET: e1
-                from("direct:start").to("language:simple:Hello+${body}").to("mock:result");
+                String script = URLEncoder.encode("Hello ${body}", "UTF-8");
+                from("direct:start").to("language:simple:" + script).to("mock:result");
                 // END SNIPPET: e1
             }
         };

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageScriptInHeaderRouteTakePrecedenceTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageScriptInHeaderRouteTakePrecedenceTest.java?rev=1164170&r1=1164169&r2=1164170&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageScriptInHeaderRouteTakePrecedenceTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/language/LanguageScriptInHeaderRouteTakePrecedenceTest.java
Thu Sep  1 17:03:10 2011
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.language;
 
+import java.net.URLEncoder;
+
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
@@ -46,7 +48,8 @@ public class LanguageScriptInHeaderRoute
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("language:simple:Bye+${body}").to("mock:result");
+                String script = URLEncoder.encode("Bye ${body}", "UTF-8");
+                from("direct:start").to("language:simple:" + script).to("mock:result");
             }
         };
     }



Mime
View raw message