svn commit: r691628 - in /activemq/camel/trunk/components/camel-script: pom.xml src/test/java/org/apache/camel/builder/script/GroovyScriptRouteTest.java src/test/resources/log4j.properties

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r691628 - in /activemq/camel/trunk/components/camel-script: pom.xml src/test/java/org/apache/camel/builder/script/GroovyScriptRouteTest.java src/test/resources/log4j.properties

davsclaus-2
Author: davsclaus
Date: Wed Sep  3 07:39:23 2008
New Revision: 691628

URL: http://svn.apache.org/viewvc?rev=691628&view=rev
Log:
Upgraded to jruby 1.1.4

Added:
    activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/GroovyScriptRouteTest.java
Modified:
    activemq/camel/trunk/components/camel-script/pom.xml
    activemq/camel/trunk/components/camel-script/src/test/resources/log4j.properties

Modified: activemq/camel/trunk/components/camel-script/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-script/pom.xml?rev=691628&r1=691627&r2=691628&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-script/pom.xml (original)
+++ activemq/camel/trunk/components/camel-script/pom.xml Wed Sep  3 07:39:23 2008
@@ -154,9 +154,9 @@
       <groupId>org.python</groupId>
       <artifactId>jython</artifactId>
       <version>2.2.1</version>
+      <scope>test</scope>
     </dependency>
 
-
     <dependency>
       <groupId>org.codehaus.groovy</groupId>
       <artifactId>groovy-all</artifactId>
@@ -166,7 +166,7 @@
     <dependency>
       <groupId>org.jruby</groupId>
       <artifactId>jruby</artifactId>
-      <version>1.1.2</version>
+      <version>1.1.4</version>
       <scope>test</scope>
     </dependency>
 
@@ -175,6 +175,12 @@
       <artifactId>junit</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <scope>test</scope>
+    </dependency>
+
   </dependencies>
 
 

Added: activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/GroovyScriptRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/GroovyScriptRouteTest.java?rev=691628&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/GroovyScriptRouteTest.java (added)
+++ activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/GroovyScriptRouteTest.java Wed Sep  3 07:39:23 2008
@@ -0,0 +1,30 @@
+package org.apache.camel.builder.script;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.builder.RouteBuilder;
+import static org.apache.camel.builder.script.ScriptBuilder.groovy;
+
+/**
+ * Unit test for a Groovy script based on end-user question.
+ */
+public class GroovyScriptRouteTest extends ContextTestSupport {
+
+    public void testGroovyScript() throws Exception {
+        //TODO: fix me
+        //MockEndpoint mock = getMockEndpoint("mock:result");
+        //mock.expectedHeaderReceived("foo", "Hello World");
+
+        //template.sendBodyAndHeader("seda:a", "Hello World", "foo", "London");
+
+        //mock.assertIsSatisfied();
+    }
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                from("seda:a").setHeader("foo", groovy("request.body")).to("mock:result");
+            }
+        };
+    }
+}

Modified: activemq/camel/trunk/components/camel-script/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-script/src/test/resources/log4j.properties?rev=691628&r1=691627&r2=691628&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-script/src/test/resources/log4j.properties (original)
+++ activemq/camel/trunk/components/camel-script/src/test/resources/log4j.properties Wed Sep  3 07:39:23 2008
@@ -18,7 +18,7 @@
 #
 # The logging properties used for eclipse testing, We want to see debug output on the console.
 #
-log4j.rootLogger=INFO, out
+log4j.rootLogger=INFO, file
 
 #log4j.logger.org.apache.camel=DEBUG
 log4j.logger.org.springframework=WARN
@@ -28,3 +28,9 @@
 log4j.appender.out.layout=org.apache.log4j.PatternLayout
 log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n
 #log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+# File appender
+log4j.appender.file=org.apache.log4j.FileAppender
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d %-5p %c{1} - %m %n
+log4j.appender.file.file=target/camel-script-test.log