Repository: camel Updated Branches: refs/heads/master ef764be21 -> d6812ffe4
CAMEL-8475 Added test to verify the issue Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d6812ffe Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d6812ffe Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d6812ffe Branch: refs/heads/master Commit: d6812ffe44606117865a60141fef9f6dce9d2df1 Parents: ef764be Author: Willem Jiang <[email protected]> Authored: Thu Mar 12 17:57:11 2015 +0800 Committer: Willem Jiang <[email protected]> Committed: Thu Mar 12 17:57:32 2015 +0800 ---------------------------------------------------------------------- components/camel-testng/pom.xml | 4 +++ ...lTestNGSpringContextTestsJavaConfigTest.java | 38 ++++++++++++++++++++ .../camel/testng/SpringTestConfiguration.java | 27 ++++++++++++++ 3 files changed, 69 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/d6812ffe/components/camel-testng/pom.xml ---------------------------------------------------------------------- diff --git a/components/camel-testng/pom.xml b/components/camel-testng/pom.xml index ec938df..cfaba0e 100644 --- a/components/camel-testng/pom.xml +++ b/components/camel-testng/pom.xml @@ -45,6 +45,10 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-javaconfig</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>${camel-test-spring-artifactId}</artifactId> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/camel/blob/d6812ffe/components/camel-testng/src/test/java/org/apache/camel/testng/AbstractCamelTestNGSpringContextTestsJavaConfigTest.java ---------------------------------------------------------------------- diff --git a/components/camel-testng/src/test/java/org/apache/camel/testng/AbstractCamelTestNGSpringContextTestsJavaConfigTest.java b/components/camel-testng/src/test/java/org/apache/camel/testng/AbstractCamelTestNGSpringContextTestsJavaConfigTest.java new file mode 100644 index 0000000..15aed38 --- /dev/null +++ b/components/camel-testng/src/test/java/org/apache/camel/testng/AbstractCamelTestNGSpringContextTestsJavaConfigTest.java @@ -0,0 +1,38 @@ +/** + * 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.testng; + +import org.apache.camel.CamelContext; +import org.apache.camel.test.spring.CamelSpringDelegatingTestContextLoader; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.context.ContextConfiguration; +import org.testng.Assert; +import org.testng.annotations.Test; + +@ContextConfiguration(classes = SpringTestConfiguration.class, loader = CamelSpringDelegatingTestContextLoader.class, inheritLocations = false) +@DirtiesContext +public class AbstractCamelTestNGSpringContextTestsJavaConfigTest + extends AbstractCamelTestNGSpringContextTests { + @Autowired + private CamelContext camelContext; + + @Test + public void test() { + Assert.assertNotNull(camelContext); + } +} http://git-wip-us.apache.org/repos/asf/camel/blob/d6812ffe/components/camel-testng/src/test/java/org/apache/camel/testng/SpringTestConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-testng/src/test/java/org/apache/camel/testng/SpringTestConfiguration.java b/components/camel-testng/src/test/java/org/apache/camel/testng/SpringTestConfiguration.java new file mode 100644 index 0000000..575d587 --- /dev/null +++ b/components/camel-testng/src/test/java/org/apache/camel/testng/SpringTestConfiguration.java @@ -0,0 +1,27 @@ +/** + * 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.testng; + +import org.apache.camel.spring.javaconfig.CamelConfiguration; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; + +@Configuration +@ComponentScan("org.apache.camel.testng") +public class SpringTestConfiguration extends CamelConfiguration { + +} \ No newline at end of file
