You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2010/05/11 03:36:43 UTC
svn commit: r942972 - in /camel/trunk/components/camel-spring/src/test:
java/org/apache/camel/spring/issues/
resources/org/apache/camel/spring/issues/
Author: ningjiang
Date: Tue May 11 01:36:42 2010
New Revision: 942972
URL: http://svn.apache.org/viewvc?rev=942972&view=rev
Log:
CAMEL-2697 Adding the test case as the user said
Added:
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/MyProcessor.java (with props)
Modified:
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/MyInjectionRouteBuilder.java
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/CamelRouteRefInjectionIssueTest.xml
Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/MyInjectionRouteBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/MyInjectionRouteBuilder.java?rev=942972&r1=942971&r2=942972&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/MyInjectionRouteBuilder.java (original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/MyInjectionRouteBuilder.java Tue May 11 01:36:42 2010
@@ -19,15 +19,16 @@ package org.apache.camel.spring.issues;
import org.apache.camel.CamelContext;
import org.apache.camel.CamelContextAware;
import org.apache.camel.Endpoint;
+import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
/**
* @version $Revision$
*/
-public class MyInjectionRouteBuilder extends RouteBuilder implements CamelContextAware {
+public class MyInjectionRouteBuilder extends RouteBuilder {
private String startEndpointUri;
- private CamelContext camelContext;
+ private Processor myProcessor;
public void setStartEndpointUri(String startUri) {
startEndpointUri = startUri;
@@ -37,20 +38,18 @@ public class MyInjectionRouteBuilder ext
return startEndpointUri;
}
- public Endpoint getStartEndpoint() {
- return camelContext.getEndpoint(startEndpointUri);
+ public void setMyProcessor(Processor processor) {
+ myProcessor = processor;
}
-
- public void configure() throws Exception {
- from(getStartEndpoint()).to("mock:result");
+
+ public Processor getMyProcessor() {
+ return myProcessor;
}
-
- public CamelContext getCamelContext() {
- return camelContext;
+
+ public void configure() throws Exception {
+ from(getStartEndpointUri()).process(getMyProcessor()).to("mock:result");
}
- public void setCamelContext(CamelContext context) {
- camelContext = context;
- }
+
}
Added: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/MyProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/MyProcessor.java?rev=942972&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/MyProcessor.java (added)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/MyProcessor.java Tue May 11 01:36:42 2010
@@ -0,0 +1,29 @@
+/**
+ * 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.Exchange;
+import org.apache.camel.Processor;
+
+public class MyProcessor implements Processor {
+
+ public void process(Exchange exchange) throws Exception {
+ // Do nothing here
+
+ }
+
+}
Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/MyProcessor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/MyProcessor.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/CamelRouteRefInjectionIssueTest.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/CamelRouteRefInjectionIssueTest.xml?rev=942972&r1=942971&r2=942972&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/CamelRouteRefInjectionIssueTest.xml (original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/CamelRouteRefInjectionIssueTest.xml Tue May 11 01:36:42 2010
@@ -18,7 +18,7 @@
<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://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
">
@@ -28,6 +28,9 @@
<bean id="myRoute" class="org.apache.camel.spring.issues.MyInjectionRouteBuilder">
<property name="startEndpointUri" value="direct:start"/>
+ <property name="myProcessor" ref="myProcessor"/>
</bean>
+
+ <bean id="myProcessor" class="org.apache.camel.spring.issues.MyProcessor"/>
</beans>