You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2008/09/29 20:43:21 UTC
svn commit: r700202 - in
/activemq/camel/trunk/components/camel-script/src/test:
java/org/apache/camel/builder/script/example/
resources/org/apache/camel/builder/script/example/
Author: davsclaus
Date: Mon Sep 29 11:43:21 2008
New Revision: 700202
URL: http://svn.apache.org/viewvc?rev=700202&view=rev
Log:
CAMEL-907: Added more spring xml samples for scripting languages
Added:
activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/JavaScriptFilterTest.java (contents, props changed)
- copied, changed from r700185, activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/GroovyFilterTest.java
activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/PythonFilterTest.java
activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/RubyFilterTest.java
activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/javaScriptFilter.xml (contents, props changed)
- copied, changed from r700185, activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/groovyFilter.xml
activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/pythonFilter.xml
activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/rubyFilter.xml
Copied: activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/JavaScriptFilterTest.java (from r700185, activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/GroovyFilterTest.java)
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/JavaScriptFilterTest.java?p2=activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/JavaScriptFilterTest.java&p1=activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/GroovyFilterTest.java&r1=700185&r2=700202&rev=700202&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/GroovyFilterTest.java (original)
+++ activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/JavaScriptFilterTest.java Mon Sep 29 11:43:21 2008
@@ -26,14 +26,15 @@
/**
* @version $Revision$
*/
-public class GroovyFilterTest extends XPathFilterTest {
+public class JavaScriptFilterTest extends XPathFilterTest {
+
@Override
protected CamelContext createCamelContext() throws Exception {
- return SpringCamelContext.springCamelContext(new ClassPathXmlApplicationContext("org/apache/camel/builder/script/example/groovyFilter.xml"));
+ return SpringCamelContext.springCamelContext(new ClassPathXmlApplicationContext("org/apache/camel/builder/script/example/javaScriptFilter.xml"));
}
@Override
protected RouteBuilder createRouteBuilder() {
return NoRouteBuilder.getInstance();
}
-}
+}
\ No newline at end of file
Propchange: activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/JavaScriptFilterTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/JavaScriptFilterTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/JavaScriptFilterTest.java
------------------------------------------------------------------------------
svn:mergeinfo =
Added: activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/PythonFilterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/PythonFilterTest.java?rev=700202&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/PythonFilterTest.java (added)
+++ activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/PythonFilterTest.java Mon Sep 29 11:43:21 2008
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.builder.script.example;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.builder.NoRouteBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.processor.XPathFilterTest;
+import org.apache.camel.spring.SpringCamelContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+/**
+ * @version $Revision$
+ */
+public class PythonFilterTest extends XPathFilterTest {
+
+ @Override
+ protected CamelContext createCamelContext() throws Exception {
+ return SpringCamelContext.springCamelContext(new ClassPathXmlApplicationContext("org/apache/camel/builder/script/example/pythonFilter.xml"));
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return NoRouteBuilder.getInstance();
+ }
+}
\ No newline at end of file
Added: activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/RubyFilterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/RubyFilterTest.java?rev=700202&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/RubyFilterTest.java (added)
+++ activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/example/RubyFilterTest.java Mon Sep 29 11:43:21 2008
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.builder.script.example;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.builder.NoRouteBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.processor.XPathFilterTest;
+import org.apache.camel.spring.SpringCamelContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+/**
+ * @version $Revision$
+ */
+public class RubyFilterTest extends XPathFilterTest {
+
+ @Override
+ protected CamelContext createCamelContext() throws Exception {
+ return SpringCamelContext.springCamelContext(new ClassPathXmlApplicationContext("org/apache/camel/builder/script/example/rubyFilter.xml"));
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return NoRouteBuilder.getInstance();
+ }
+}
\ No newline at end of file
Copied: activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/javaScriptFilter.xml (from r700185, activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/groovyFilter.xml)
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/javaScriptFilter.xml?p2=activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/javaScriptFilter.xml&p1=activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/groovyFilter.xml&r1=700185&r2=700202&rev=700202&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/groovyFilter.xml (original)
+++ activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/javaScriptFilter.xml Mon Sep 29 11:43:21 2008
@@ -22,16 +22,16 @@
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
">
- <!-- START SNIPPET: example -->
- <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
- <route>
- <from uri="direct:start"/>
- <filter>
- <groovy>exchange.in.headers.testCase == 'testSendMatchingMessage'</groovy>
- <to uri="mock:result"/>
- </filter>
- </route>
- </camelContext>
- <!-- END SNIPPET: example -->
+ <!-- START SNIPPET: example -->
+ <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
+ <route>
+ <from uri="direct:start"/>
+ <filter>
+ <javaScript>request.headers.get('testCase') == 'testSendMatchingMessage'</javaScript>
+ <to uri="mock:result"/>
+ </filter>
+ </route>
+ </camelContext>
+ <!-- END SNIPPET: example -->
</beans>
Propchange: activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/javaScriptFilter.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/javaScriptFilter.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/javaScriptFilter.xml
------------------------------------------------------------------------------
svn:mergeinfo =
Propchange: activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/javaScriptFilter.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/pythonFilter.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/pythonFilter.xml?rev=700202&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/pythonFilter.xml (added)
+++ activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/pythonFilter.xml Mon Sep 29 11:43:21 2008
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
+ ">
+
+ <!-- START SNIPPET: example -->
+ <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
+ <route>
+ <from uri="direct:start"/>
+ <filter>
+ <python>request.headers['testCase'] == 'testSendMatchingMessage'</python>
+ <to uri="mock:result"/>
+ </filter>
+ </route>
+ </camelContext>
+ <!-- END SNIPPET: example -->
+
+</beans>
Added: activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/rubyFilter.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/rubyFilter.xml?rev=700202&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/rubyFilter.xml (added)
+++ activemq/camel/trunk/components/camel-script/src/test/resources/org/apache/camel/builder/script/example/rubyFilter.xml Mon Sep 29 11:43:21 2008
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
+ ">
+
+ <!-- START SNIPPET: example -->
+ <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
+ <route>
+ <from uri="direct:start"/>
+ <filter>
+ <ruby>$request.headers['testCase'] == 'testSendMatchingMessage'</ruby>
+ <to uri="mock:result"/>
+ </filter>
+ </route>
+ </camelContext>
+ <!-- END SNIPPET: example -->
+
+</beans>