Updated Branches: refs/heads/master f98301227 -> edf0e1d35
[Spring-JavaConfig] Added test case verifying that loading raw CamelConfiguration is possible. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/edf0e1d3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/edf0e1d3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/edf0e1d3 Branch: refs/heads/master Commit: edf0e1d35dbebc4d591e28ed16112a731d3f66d2 Parents: f983012 Author: Henryk Konsek <hekon...@gmail.com> Authored: Wed Oct 23 14:44:10 2013 +0200 Committer: Henryk Konsek <hekon...@gmail.com> Committed: Wed Oct 23 14:44:10 2013 +0200 ---------------------------------------------------------------------- .../LoadingRawCamelConfigurationTest.java | 60 ++++++++++++++++++++ 1 file changed, 60 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/edf0e1d3/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/autowire/LoadingRawCamelConfigurationTest.java ---------------------------------------------------------------------- diff --git a/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/autowire/LoadingRawCamelConfigurationTest.java b/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/autowire/LoadingRawCamelConfigurationTest.java new file mode 100644 index 0000000..4a39769 --- /dev/null +++ b/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/autowire/LoadingRawCamelConfigurationTest.java @@ -0,0 +1,60 @@ +/** + * 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.javaconfig.autowire; + +import static junit.framework.Assert.assertNotNull; +import org.apache.camel.EndpointInject; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.spring.javaconfig.test.JavaConfigContextLoader; +import org.junit.Test; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; + + +@ContextConfiguration( + locations = {"org.apache.camel.spring.javaconfig.CamelConfiguration", + "org.apache.camel.spring.javaconfig.autowire.AdditionalRouteConfiguration"}, + loader = JavaConfigContextLoader.class) +public class LoadingRawCamelConfigurationTest extends AbstractJUnit4SpringContextTests { + + @EndpointInject(uri = "mock:rawConfigTest") + MockEndpoint moduleMockEndpoint; + + @Test + public void shouldAutodetectRouteBuilders() throws InterruptedException { + assertNotNull(moduleMockEndpoint); + } + +} + +@Configuration +class AdditionalRouteConfiguration { + + @Bean + public RouteBuilder routeBuilder() { + return new RouteBuilder() { + @Override + public void configure() throws Exception { + from("direct:rawConfigTest").to("mock:rawConfigTest"); + } + }; + } + +}