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 2010/09/17 12:49:19 UTC

svn commit: r998064 - in /camel/trunk/components/camel-spring/src/test: java/org/apache/camel/spring/issues/ resources/org/apache/camel/spring/issues/

Author: davsclaus
Date: Fri Sep 17 10:49:18 2010
New Revision: 998064

URL: http://svn.apache.org/viewvc?rev=998064&view=rev
Log:
Added test based on user forum issue

Added:
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/MyCoolRoute.java
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringPropertyPlaceholderIssueTest.java
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringPropertyPlaceholderIssueTest.xml
      - copied, changed from r997858, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/ProduceSplitMethodCallIssueTest.xml
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/myprop.properties

Added: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/MyCoolRoute.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/MyCoolRoute.java?rev=998064&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/MyCoolRoute.java (added)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/MyCoolRoute.java Fri Sep 17 10:49:18 2010
@@ -0,0 +1,36 @@
+/**
+ * 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.spring.issues;
+
+import org.apache.camel.builder.RouteBuilder;
+
+/**
+ * @version $Revision$
+ */
+public class MyCoolRoute extends RouteBuilder {
+
+    private String inputQueue;
+
+    public void setInputQueue(String inputQueue) {
+        this.inputQueue = inputQueue;
+    }
+
+    @Override
+    public void configure() throws Exception {
+        from(inputQueue).to("mock:result");
+    }
+}

Added: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringPropertyPlaceholderIssueTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringPropertyPlaceholderIssueTest.java?rev=998064&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringPropertyPlaceholderIssueTest.java (added)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringPropertyPlaceholderIssueTest.java Fri Sep 17 10:49:18 2010
@@ -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.spring.issues;
+
+import org.apache.camel.spring.SpringTestSupport;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+/**
+ * @version $Revision$
+ */
+public class SpringPropertyPlaceholderIssueTest extends SpringTestSupport {
+
+    @Override
+    protected AbstractXmlApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/camel/spring/issues/SpringPropertyPlaceholderIssueTest.xml");
+    }
+
+    public void testSpring() throws Exception {
+        getMockEndpoint("mock:result").expectedMessageCount(1);
+
+        template.sendBody("direct:start", "Hello World");
+
+        assertMockEndpointsSatisfied();
+    }
+}

Copied: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringPropertyPlaceholderIssueTest.xml (from r997858, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/ProduceSplitMethodCallIssueTest.xml)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringPropertyPlaceholderIssueTest.xml?p2=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringPropertyPlaceholderIssueTest.xml&p1=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/ProduceSplitMethodCallIssueTest.xml&r1=997858&r2=998064&rev=998064&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/ProduceSplitMethodCallIssueTest.xml (original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringPropertyPlaceholderIssueTest.xml Fri Sep 17 10:49:18 2010
@@ -22,18 +22,16 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <bean id="cool" class="org.apache.camel.spring.issues.CoolService"/>
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+        <property name="location" value="classpath:org/apache/camel/spring/issues/myprop.properties"/>
+    </bean>
+
+    <bean id="myRoute" class="org.apache.camel.spring.issues.MyCoolRoute">
+        <property name="inputQueue" value="${inputQueue}"/>
+    </bean>
 
     <camelContext trace="true" xmlns="http://camel.apache.org/schema/spring">
-        <route>
-            <from uri="direct:start"/>
-            <to uri="log:foo"/>
-            <split>
-                <method bean="cool" method="split"/>
-                <transform><simple>Hello ${body}</simple></transform>
-                <to uri="mock:split"/>
-            </split>
-        </route>
+        <routeBuilder ref="myRoute"/>
     </camelContext>
 
 </beans>

Added: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/myprop.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/myprop.properties?rev=998064&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/myprop.properties (added)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/myprop.properties Fri Sep 17 10:49:18 2010
@@ -0,0 +1,18 @@
+## ------------------------------------------------------------------------
+## 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.
+## ------------------------------------------------------------------------
+
+inputQueue=direct:start
\ No newline at end of file