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 2009/06/17 08:04:53 UTC
svn commit: r785479 [2/2] - in /camel/trunk:
camel-core/src/main/java/org/apache/camel/impl/
camel-core/src/main/java/org/apache/camel/impl/scan/
camel-core/src/main/java/org/apache/camel/model/
camel-core/src/main/java/org/apache/camel/spi/ camel-core...
Added: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/scan/SpringComponentScanWithDeprecatedPackagesTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/scan/SpringComponentScanWithDeprecatedPackagesTest.java?rev=785479&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/scan/SpringComponentScanWithDeprecatedPackagesTest.java (added)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/scan/SpringComponentScanWithDeprecatedPackagesTest.java Wed Jun 17 06:04:52 2009
@@ -0,0 +1,43 @@
+/**
+ * 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.config.scan;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class SpringComponentScanWithDeprecatedPackagesTest extends ContextTestSupport {
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ ApplicationContext c = new ClassPathXmlApplicationContext("org/apache/camel/spring/config/scan/componentScanWithPackages.xml");
+ context = (CamelContext)c.getBean("camelContext");
+ template = context.createProducerTemplate();
+
+ }
+
+ public void testSpringComponentScanFeature() throws InterruptedException {
+ template.sendBody("direct:start", "request");
+ MockEndpoint mock = getMockEndpoint("mock:end");
+ mock.expectedMessageCount(1);
+ mock.assertIsSatisfied();
+ }
+}
Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/scan/SpringComponentScanWithDeprecatedPackagesTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/scan/SpringComponentScanWithDeprecatedPackagesTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/scan/route/MyExcludedRouteBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/scan/route/MyExcludedRouteBuilder.java?rev=785479&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/scan/route/MyExcludedRouteBuilder.java (added)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/scan/route/MyExcludedRouteBuilder.java Wed Jun 17 06:04:52 2009
@@ -0,0 +1,28 @@
+/**
+ * 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.config.scan.route;
+
+import org.apache.camel.builder.RouteBuilder;
+
+public class MyExcludedRouteBuilder extends RouteBuilder {
+
+ @Override
+ public void configure() throws Exception {
+ from("direct:shouldNeverRecieveExchange").to("mock:definitelyShouldNeverReceiveExchange");
+ }
+}
Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/scan/route/MyExcludedRouteBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/scan/route/MyExcludedRouteBuilder.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/componentScan.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/componentScan.xml?rev=785479&r1=785478&r2=785479&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/componentScan.xml (original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/componentScan.xml Wed Jun 17 06:04:52 2009
@@ -26,7 +26,11 @@
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<camelContext xmlns="http://camel.apache.org/schema/spring">
- <package>org.apache.camel.spring.config.scan.route</package>
+ <packageScan>
+ <packages>org.apache.camel.spring.config.scan</packages>
+ <excludes>**/*Excluded*</excludes>
+ <includes>**/*</includes>
+ </packageScan>
<endpoint id="start" uri="direct:start"/>
<endpoint id="result" uri="mock:end"/>
</camelContext>
Added: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/componentScanWithPackages.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/componentScanWithPackages.xml?rev=785479&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/componentScanWithPackages.xml (added)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/componentScanWithPackages.xml Wed Jun 17 06:04:52 2009
@@ -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"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://camel.apache.org/schema/spring
+ http://camel.apache.org/schema/spring/camel-spring.xsd
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-2.5.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+ <package>org.apache.camel.spring.config.scan.route</package>
+ <endpoint id="start" uri="direct:start"/>
+ <endpoint id="result" uri="mock:end"/>
+ </camelContext>
+
+ <context:component-scan
+ base-package="org.apache.camel.spring.config.scan.component" />
+
+</beans>
Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/componentScanWithPackages.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/componentScanWithPackages.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/componentScanWithPackages.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/explicitlyDefinedRouteExclusion.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/explicitlyDefinedRouteExclusion.xml?rev=785479&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/explicitlyDefinedRouteExclusion.xml (added)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/explicitlyDefinedRouteExclusion.xml Wed Jun 17 06:04:52 2009
@@ -0,0 +1,40 @@
+<?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"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://camel.apache.org/schema/spring
+ http://camel.apache.org/schema/spring/camel-spring.xsd
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-2.5.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+ <beanPostProcessor />
+ <endpoint id="start" uri="direct:start"/>
+ <endpoint id="result" uri="mock:end"/>
+ </camelContext>
+
+ <bean id="explicitlyDefinedRoute" class="org.apache.camel.spring.config.scan.route.MyRouteBuilder" autowire="byType" />
+ <bean id="explicitlyDefinedButExcludedRoute" class="org.apache.camel.spring.config.unscanned.MyExplicitlyDefinedButExcludedRouteBuilder" />
+
+ <context:component-scan
+ base-package="org.apache.camel.spring.config.scan.component" />
+
+</beans>
Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/explicitlyDefinedRouteExclusion.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/explicitlyDefinedRouteExclusion.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/scan/explicitlyDefinedRouteExclusion.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml