http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/CamelSpringTestHelper.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/CamelSpringTestHelper.java b/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/CamelSpringTestHelper.java deleted file mode 100644 index aa75c0e..0000000 --- a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/CamelSpringTestHelper.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * 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.test.spring; - -import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.apache.camel.spring.SpringCamelContext; - -import org.springframework.context.ApplicationContext; - -/** - * Helper that provides state information across the levels of Spring Test that do not expose the - * necessary context/state for integration of Camel testing features into Spring test. Also - * provides utility methods. - * <p/> - * Note that this class makes use of {@link ThreadLocal}s to maintain some state. It is imperative - * that the state setters and getters are accessed within the scope of a single thread in order - * for this class to work right. - */ -public final class CamelSpringTestHelper { - - private static ThreadLocal<String> originalJmxDisabledValue = new ThreadLocal<String>(); - private static ThreadLocal<Class<?>> testClazz = new ThreadLocal<Class<?>>(); - - private CamelSpringTestHelper() { - } - - public static String getOriginalJmxDisabled() { - return originalJmxDisabledValue.get(); - } - - public static void setOriginalJmxDisabledValue(String originalValue) { - originalJmxDisabledValue.set(originalValue); - } - - public static Class<?> getTestClass() { - return testClazz.get(); - } - - public static void setTestClass(Class<?> testClass) { - testClazz.set(testClass); - } - - /** - * Returns all methods defined in {@code clazz} and its superclasses/interfaces. - */ - public static Collection<Method> getAllMethods(Class<?> clazz) { - Set<Method> methods = new LinkedHashSet<Method>(); - Class<?> currentClass = clazz; - - while (currentClass != null) { - methods.addAll(Arrays.asList(clazz.getMethods())); - currentClass = currentClass.getSuperclass(); - } - - return methods; - } - - /** - * Executes {@code strategy} against all {@link SpringCamelContext}s found in the Spring context. - * This method reduces the amount of repeated find and loop code throughout this class. - * - * @param context the Spring context to search - * @param strategy the strategy to execute against the found {@link SpringCamelContext}s - * - * @throws Exception if there is an error executing any of the strategies - */ - public static void doToSpringCamelContexts(ApplicationContext context, DoToSpringCamelContextsStrategy strategy) throws Exception { - Map<String, SpringCamelContext> contexts = context.getBeansOfType(SpringCamelContext.class); - - for (Entry<String, SpringCamelContext> entry : contexts.entrySet()) { - strategy.execute(entry.getKey(), entry.getValue()); - } - } - - public interface DoToSpringCamelContextsStrategy { - void execute(String contextName, SpringCamelContext camelContext) throws Exception; - } -}
http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/CamelSpringTestSupport.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/CamelSpringTestSupport.java b/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/CamelSpringTestSupport.java deleted file mode 100644 index b855b40..0000000 --- a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/CamelSpringTestSupport.java +++ /dev/null @@ -1,220 +0,0 @@ -/** - * 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.test.spring; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; - -import org.apache.camel.CamelContext; -import org.apache.camel.spring.CamelBeanPostProcessor; -import org.apache.camel.spring.SpringCamelContext; -import org.apache.camel.test.ExcludingPackageScanClassResolver; -import org.apache.camel.test.junit4.CamelTestSupport; -import org.apache.camel.util.IOHelper; -import org.apache.camel.util.ObjectHelper; -import org.junit.After; -import org.junit.AfterClass; -import org.springframework.beans.factory.support.RootBeanDefinition; -import org.springframework.context.ApplicationContext; -import org.springframework.context.support.AbstractApplicationContext; -import org.springframework.context.support.GenericApplicationContext; - -/** - * @version - */ -public abstract class CamelSpringTestSupport extends CamelTestSupport { - protected static ThreadLocal<AbstractApplicationContext> threadAppContext = new ThreadLocal<AbstractApplicationContext>(); - protected static Object lock = new Object(); - - protected AbstractApplicationContext applicationContext; - protected abstract AbstractApplicationContext createApplicationContext(); - - /** - * Lets post process this test instance to process any Camel annotations. - * Note that using Spring Test or Guice is a more powerful approach. - */ - @Override - public void postProcessTest() throws Exception { - super.postProcessTest(); - if (isCreateCamelContextPerClass()) { - applicationContext = threadAppContext.get(); - } - - // use the bean post processor from camel-spring - CamelBeanPostProcessor processor = new CamelBeanPostProcessor(); - processor.setApplicationContext(applicationContext); - processor.setCamelContext(context); - processor.postProcessBeforeInitialization(this, getClass().getName()); - processor.postProcessAfterInitialization(this, getClass().getName()); - } - - @Override - public void doPreSetup() throws Exception { - if (!"true".equalsIgnoreCase(System.getProperty("skipStartingCamelContext"))) { - // tell camel-spring it should not trigger starting CamelContext, since we do that later - // after we are finished setting up the unit test - synchronized (lock) { - SpringCamelContext.setNoStart(true); - if (isCreateCamelContextPerClass()) { - applicationContext = threadAppContext.get(); - if (applicationContext == null) { - applicationContext = doCreateApplicationContext(); - threadAppContext.set(applicationContext); - } - } else { - applicationContext = doCreateApplicationContext(); - } - SpringCamelContext.setNoStart(false); - } - } else { - log.info("Skipping starting CamelContext as system property skipStartingCamelContext is set to be true."); - } - } - - private AbstractApplicationContext doCreateApplicationContext() { - AbstractApplicationContext context = createApplicationContext(); - assertNotNull("Should have created a valid Spring application context", context); - - String[] profiles = activeProfiles(); - if (profiles != null && profiles.length > 0) { - // the context must not be active - if (context.isActive()) { - throw new IllegalStateException("Cannot active profiles: " + Arrays.asList(profiles) + " on active Spring application context: " + context - + ". The code in your createApplicationContext() method should be adjusted to create the application context with refresh = false as parameter"); - } - log.info("Spring activating profiles: {}", Arrays.asList(profiles)); - context.getEnvironment().setActiveProfiles(profiles); - } - - // ensure the context has been refreshed at least once - if (!context.isActive()) { - context.refresh(); - } - - return context; - } - - @Override - @After - public void tearDown() throws Exception { - super.tearDown(); - - if (!isCreateCamelContextPerClass()) { - IOHelper.close(applicationContext); - applicationContext = null; - } - } - - @AfterClass - public static void tearSpringDownAfterClass() throws Exception { - if (threadAppContext.get() != null) { - IOHelper.close(threadAppContext.get()); - threadAppContext.remove(); - } - } - - /** - * Create a parent context that initializes a - * {@link org.apache.camel.spi.PackageScanClassResolver} to exclude a set of given classes from - * being resolved. Typically this is used at test time to exclude certain routes, - * which might otherwise be just noisy, from being discovered and initialized. - * <p/> - * To use this filtering mechanism it is necessary to provide the - * {@link org.springframework.context.ApplicationContext} returned from here as the parent context to - * your test context e.g. - * - * <pre> - * protected AbstractXmlApplicationContext createApplicationContext() { - * return new ClassPathXmlApplicationContext(new String[] {"test-context.xml"}, getRouteExcludingApplicationContext()); - * } - * </pre> - * - * This will, in turn, call the template methods <code>excludedRoutes</code> - * and <code>excludedRoute</code> to determine the classes to be excluded from scanning. - * - * @return ApplicationContext a parent {@link org.springframework.context.ApplicationContext} configured - * to exclude certain classes from package scanning - */ - protected ApplicationContext getRouteExcludingApplicationContext() { - GenericApplicationContext routeExcludingContext = new GenericApplicationContext(); - routeExcludingContext.registerBeanDefinition("excludingResolver", new RootBeanDefinition(ExcludingPackageScanClassResolver.class)); - routeExcludingContext.refresh(); - - ExcludingPackageScanClassResolver excludingResolver = routeExcludingContext.getBean("excludingResolver", ExcludingPackageScanClassResolver.class); - List<Class<?>> excluded = Arrays.asList(excludeRoutes()); - excludingResolver.setExcludedClasses(new HashSet<Class<?>>(excluded)); - - return routeExcludingContext; - } - - /** - * Template method used to exclude {@link org.apache.camel.Route} from the test time context - * route scanning - * - * @return Class[] the classes to be excluded from test time context route scanning - */ - protected Class<?>[] excludeRoutes() { - Class<?> excludedRoute = excludeRoute(); - return excludedRoute != null ? new Class[] {excludedRoute} : new Class[0]; - } - - /** - * Template method used to exclude a {@link org.apache.camel.Route} from the test camel context - */ - protected Class<?> excludeRoute() { - return null; - } - - /** - * Looks up the mandatory spring bean of the given name and type, failing if - * it is not present or the correct type - */ - public <T> T getMandatoryBean(Class<T> type, String name) { - Object value = applicationContext.getBean(name); - assertNotNull("No spring bean found for name <" + name + ">", value); - if (type.isInstance(value)) { - return type.cast(value); - } else { - fail("Spring bean <" + name + "> is not an instanceof " + type.getName() + " but is of type " + ObjectHelper.className(value)); - return null; - } - } - - /** - * Which active profiles should be used. - * <p/> - * <b>Important:</b> When using active profiles, then the code in {@link #createApplicationContext()} should create - * the Spring {@link org.springframework.context.support.AbstractApplicationContext} without refreshing. For example creating an - * {@link org.springframework.context.support.ClassPathXmlApplicationContext} you would need to pass in - * <tt>false</tt> in the refresh parameter, in the constructor. - * Camel will thrown an {@link IllegalStateException} if this is not correct stating this problem. - * The reason is that we cannot active profiles <b>after</b> a Spring application context has already - * been refreshed, and is active. - * - * @return an array of active profiles to use, use <tt>null</tt> to not use any active profiles. - */ - protected String[] activeProfiles() { - return null; - } - - @Override - protected CamelContext createCamelContext() throws Exception { - // don't start the springCamelContext if we - return SpringCamelContext.springCamelContext(applicationContext, false); - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/CamelTestContextBootstrapper.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/CamelTestContextBootstrapper.java b/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/CamelTestContextBootstrapper.java deleted file mode 100644 index 169eed1..0000000 --- a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/CamelTestContextBootstrapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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.test.spring; - -import org.springframework.test.context.ContextLoader; -import org.springframework.test.context.support.DefaultTestContextBootstrapper; - -/** - * To boostrap Camel for testing with Spring 4.1 onwards. - */ -public class CamelTestContextBootstrapper extends DefaultTestContextBootstrapper { - - @Override - protected Class<? extends ContextLoader> getDefaultContextLoaderClass(Class<?> testClass) { - return CamelSpringTestContextLoader.class; - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/DisableJmx.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/DisableJmx.java b/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/DisableJmx.java deleted file mode 100644 index 1dd0ab1..0000000 --- a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/DisableJmx.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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.test.spring; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Indicates if JMX should be globally disabled in the {@code CamelContext}s that are bootstrapped - * during the test through the use of Spring Test loaded application contexts. Note that the - * presence of this annotation will result in the manipulation of System Properties that - * will affect Camel contexts constructed outside of the Spring Test loaded application contexts. - */ -@Documented -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE}) -public @interface DisableJmx { - - /** - * Whether the test annotated with this annotation should be run with JMX disabled in Camel. - * Defaults to {@code true}. - */ - boolean value() default true; -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/DisableJmxTestExecutionListener.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/DisableJmxTestExecutionListener.java b/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/DisableJmxTestExecutionListener.java deleted file mode 100644 index 1f16ebc..0000000 --- a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/DisableJmxTestExecutionListener.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 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.test.spring; - -import org.apache.camel.management.JmxSystemPropertyKeys; -import org.springframework.test.context.TestContext; -import org.springframework.test.context.support.AbstractTestExecutionListener; - -/** - * Provides reset to pre-test state behavior for global enable/disable of JMX - * support in Camel through the use of {@link DisableJmx}. - * Tries to ensure that the pre-test value is restored. - */ -public class DisableJmxTestExecutionListener extends AbstractTestExecutionListener { - - @Override - public void afterTestClass(TestContext testContext) throws Exception { - if (CamelSpringTestHelper.getOriginalJmxDisabled() == null) { - System.clearProperty(JmxSystemPropertyKeys.DISABLED); - } else { - System.setProperty(JmxSystemPropertyKeys.DISABLED, CamelSpringTestHelper.getOriginalJmxDisabled()); - } - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/ExcludeRoutes.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/ExcludeRoutes.java b/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/ExcludeRoutes.java deleted file mode 100644 index 2b1617d..0000000 --- a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/ExcludeRoutes.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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.test.spring; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.apache.camel.RoutesBuilder; - -/** - * Indicates if certain route builder classes should be excluded from discovery. - * Initializes a {@link org.apache.camel.spi.PackageScanClassResolver} to exclude a set of given - * classes from being resolved. Typically this is used at test time to exclude certain routes, - * which might otherwise be noisy, from being discovered and initialized. - */ -@Documented -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE}) -public @interface ExcludeRoutes { - - /** - * The classes to exclude from resolution when using package scanning. - */ - Class<? extends RoutesBuilder>[] value() default {}; -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/LazyLoadTypeConverters.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/LazyLoadTypeConverters.java b/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/LazyLoadTypeConverters.java deleted file mode 100644 index dc5e349..0000000 --- a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/LazyLoadTypeConverters.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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.test.spring; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Indicates if the {@code CamelContext}s that are bootstrapped during the test through the use of Spring Test - * loaded application contexts should use lazy loading of type converters. - * - * @deprecated See <a href="https://issues.apache.org/jira/browse/CAMEL-5011">CAMEL-5011</a> for more details. - */ -@Documented -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE}) -@Deprecated -public @interface LazyLoadTypeConverters { - - /** - * Whether the test annotated with this annotation should be run with lazy type converter loading in Camel. - * Defaults to {@code false}. - */ - boolean value() default false; -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/MockEndpoints.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/MockEndpoints.java b/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/MockEndpoints.java deleted file mode 100644 index ff3f282..0000000 --- a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/MockEndpoints.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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.test.spring; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.apache.camel.impl.InterceptSendToMockEndpointStrategy; - -/** - * Triggers the auto-mocking of endpoints whose URIs match the provided filter. The default - * filter is "*" which matches all endpoints. See {@link InterceptSendToMockEndpointStrategy} for - * more details on the registration of the mock endpoints. - */ -@Documented -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE}) -public @interface MockEndpoints { - - /** - * The pattern to use for matching endpoints to enable mocking on. - */ - String value() default "*"; -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/MockEndpointsAndSkip.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/MockEndpointsAndSkip.java b/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/MockEndpointsAndSkip.java deleted file mode 100644 index 1eb7e0f..0000000 --- a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/MockEndpointsAndSkip.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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.test.spring; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.apache.camel.impl.InterceptSendToMockEndpointStrategy; - -/** - * Triggers the auto-mocking of endpoints whose URIs match the provided filter with the added provision - * that the endpoints are also skipped. The default filter is "*" which matches all endpoints. - * See {@link InterceptSendToMockEndpointStrategy} for more details on the registration of the mock endpoints. - */ -@Documented -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE}) -public @interface MockEndpointsAndSkip { - - /** - * The pattern to use for matching endpoints to enable mocking on. - */ - String value() default "*"; -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/ProvidesBreakpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/ProvidesBreakpoint.java b/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/ProvidesBreakpoint.java deleted file mode 100644 index 3aea7d8..0000000 --- a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/ProvidesBreakpoint.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * 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.test.spring; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.apache.camel.spi.Breakpoint; - -/** - * Indicates that the annotated method returns a {@link Breakpoint} for use in the test. Useful for intercepting - * traffic to all endpoints or simply for setting a break point in an IDE for debugging. The method must - * be {@code public}, {@code static}, take no arguments, and return {@link Breakpoint}. - */ -@Documented -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -public @interface ProvidesBreakpoint { -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/ShutdownTimeout.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/ShutdownTimeout.java b/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/ShutdownTimeout.java deleted file mode 100644 index 2ce1ccd..0000000 --- a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/ShutdownTimeout.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * 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.test.spring; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import java.util.concurrent.TimeUnit; - -/** - * Indicates to set the shutdown timeout of all {@code CamelContext}s instantiated through the - * use of Spring Test loaded application contexts. If no annotation is used, the timeout is - * automatically reduced to 10 seconds by the test framework. If the annotation is present the - * shutdown timeout is set based on the value of {@link #value()}. - */ -@Documented -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE}) -public @interface ShutdownTimeout { - - /** - * The shutdown timeout to set on the {@code CamelContext}(s). - * Defaults to {@code 10} seconds. - */ - int value() default 10; - - /** - * The time unit that {@link #value()} is in. - */ - TimeUnit timeUnit() default TimeUnit.SECONDS; -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/StopWatchTestExecutionListener.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/StopWatchTestExecutionListener.java b/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/StopWatchTestExecutionListener.java deleted file mode 100644 index 8796dfe..0000000 --- a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/StopWatchTestExecutionListener.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * 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.test.spring; - -import org.apache.camel.util.StopWatch; -import org.apache.camel.util.TimeUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.test.context.TestContext; -import org.springframework.test.context.support.AbstractTestExecutionListener; - -/** - * An execution listener that simulates the timing output built in to {@link org.apache.camel.test.junit4.CamelTestSupport}. - */ -public class StopWatchTestExecutionListener extends AbstractTestExecutionListener { - - protected static ThreadLocal<StopWatch> threadStopWatch = new ThreadLocal<StopWatch>(); - - /** - * Exists primarily for testing purposes, but allows for access to the underlying stop watch instance for a test. - */ - public static StopWatch getStopWatch() { - return threadStopWatch.get(); - } - - @Override - public void beforeTestMethod(TestContext testContext) throws Exception { - StopWatch stopWatch = new StopWatch(); - threadStopWatch.set(stopWatch); - } - - @Override - public void afterTestMethod(TestContext testContext) throws Exception { - StopWatch watch = threadStopWatch.get(); - if (watch != null) { - long time = watch.stop(); - Logger log = LoggerFactory.getLogger(testContext.getTestClass()); - - log.info("********************************************************************************"); - log.info("Testing done: " + testContext.getTestMethod().getName() + "(" + testContext.getTestClass().getName() + ")"); - log.info("Took: " + TimeUtils.printDuration(time) + " (" + time + " millis)"); - log.info("********************************************************************************"); - - threadStopWatch.remove(); - } - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/UseAdviceWith.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/UseAdviceWith.java b/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/UseAdviceWith.java deleted file mode 100644 index 71487d1..0000000 --- a/components/camel-test-spring41/src/main/java/org/apache/camel/test/spring/UseAdviceWith.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * 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.test.spring; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.apache.camel.CamelContext; - -/** - * Indicates the use of {@code adviceWith()} within the test class. If a class is annotated with - * this annotation and {@link UseAdviceWith#value()} returns true, any - * {@code CamelContext}s bootstrapped during the test through the use of Spring Test loaded - * application contexts will not be started automatically. The test author is responsible for - * injecting the Camel contexts into the test and executing {@link CamelContext#start()} on them - * at the appropriate time after any advice has been applied to the routes in the Camel context(s). - */ -@Documented -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE}) -public @interface UseAdviceWith { - - /** - * Whether the test annotated with this annotation should be treated as if - * {@code adviceWith()} is in use in the test and the Camel contexts should not be started - * automatically. - * Defaults to {@code true}. - */ - boolean value() default true; -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/main/resources/META-INF/LICENSE.txt ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/main/resources/META-INF/LICENSE.txt b/components/camel-test-spring41/src/main/resources/META-INF/LICENSE.txt deleted file mode 100755 index 6b0b127..0000000 --- a/components/camel-test-spring41/src/main/resources/META-INF/LICENSE.txt +++ /dev/null @@ -1,203 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed 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. - http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/main/resources/META-INF/NOTICE.txt ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/main/resources/META-INF/NOTICE.txt b/components/camel-test-spring41/src/main/resources/META-INF/NOTICE.txt deleted file mode 100644 index 2e215bf..0000000 --- a/components/camel-test-spring41/src/main/resources/META-INF/NOTICE.txt +++ /dev/null @@ -1,11 +0,0 @@ - ========================================================================= - == NOTICE file corresponding to the section 4 d of == - == the Apache License, Version 2.0, == - == in this case for the Apache Camel distribution. == - ========================================================================= - - This product includes software developed by - The Apache Software Foundation (http://www.apache.org/). - - Please read the different LICENSE files present in the licenses directory of - this distribution. http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/test/java/org/apache/camel/test/issues/AdviceWithOnExceptionMultipleIssueTest.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/test/java/org/apache/camel/test/issues/AdviceWithOnExceptionMultipleIssueTest.java b/components/camel-test-spring41/src/test/java/org/apache/camel/test/issues/AdviceWithOnExceptionMultipleIssueTest.java deleted file mode 100644 index 839dbf9..0000000 --- a/components/camel-test-spring41/src/test/java/org/apache/camel/test/issues/AdviceWithOnExceptionMultipleIssueTest.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * 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.test.issues; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.builder.AdviceWithRouteBuilder; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Test; -import org.springframework.context.support.AbstractApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -/** - * - */ -public class AdviceWithOnExceptionMultipleIssueTest extends CamelSpringTestSupport { - - @Override - protected AbstractApplicationContext createApplicationContext() { - return new ClassPathXmlApplicationContext("org/apache/camel/test/issues/AdviceWithOnExceptionMultipleIssueTest.xml"); - } - - @Override - public boolean isUseAdviceWith() { - return true; - } - - @Test - public void testSimpleMultipleAdvice() throws Exception { - context.getRouteDefinition("RouteA").adviceWith(context, new AdviceWithRouteBuilder() { - @Override - public void configure() throws Exception { - interceptSendToEndpoint("mock:resultA").process(new Processor() { - @Override - public void process(Exchange exchange) throws Exception { - } - }); - } - }); - - context.getRouteDefinition("RouteB").adviceWith(context, new AdviceWithRouteBuilder() { - @Override - public void configure() throws Exception { - } - }); - - context.start(); - - getMockEndpoint("mock:resultA").expectedMessageCount(1); - template.sendBody("direct:startA", "a trigger"); - assertMockEndpointsSatisfied(); - } - - @Test - public void testMultipleAdviceWithExceptionThrown() throws Exception { - context.getRouteDefinition("RouteA").adviceWith(context, new AdviceWithRouteBuilder() { - @Override - public void configure() throws Exception { - interceptSendToEndpoint("mock:resultA").process(new Processor() { - @Override - public void process(Exchange exchange) throws Exception { - throw new Exception("my exception"); - } - }); - } - }); - - context.start(); - - getMockEndpoint("mock:resultA").expectedMessageCount(0); - template.sendBody("direct:startA", "a trigger"); - assertMockEndpointsSatisfied(); - } - - @Test - public void testMultipleAdvice() throws Exception { - context.getRouteDefinition("RouteA").adviceWith(context, new AdviceWithRouteBuilder() { - @Override - public void configure() throws Exception { - interceptSendToEndpoint("mock:resultA").process(new Processor() { - @Override - public void process(Exchange exchange) throws Exception { - throw new Exception("my exception"); - } - }); - } - }); - - context.getRouteDefinition("RouteB").adviceWith(context, new AdviceWithRouteBuilder() { - @Override - public void configure() throws Exception { - } - }); - - context.start(); - - getMockEndpoint("mock:resultA").expectedMessageCount(0); - template.sendBody("direct:startA", "a trigger"); - assertMockEndpointsSatisfied(); - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java b/components/camel-test-spring41/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java deleted file mode 100644 index d1bf95e..0000000 --- a/components/camel-test-spring41/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * 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.test.issues; - -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Test; -import org.springframework.context.support.AbstractApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -public class MockEndpointsAndSkipTest extends CamelSpringTestSupport { - - @Override - protected AbstractApplicationContext createApplicationContext() { - return new ClassPathXmlApplicationContext("org/apache/camel/test/issues/MockEndpointsAndSkipTest.xml"); - } - - @Override - public String isMockEndpointsAndSkip() { - return "seda*"; - } - - @Test - public void testHelloWorld() throws Exception { - getMockEndpoint("mock:seda:foo").expectedBodiesReceived("Hello World"); - - template.sendBody("direct:start", "Hello World"); - - assertMockEndpointsSatisfied(); - } - - -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/DebugSpringCamelContextTest.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/DebugSpringCamelContextTest.java b/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/DebugSpringCamelContextTest.java deleted file mode 100644 index 0a13b66..0000000 --- a/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/DebugSpringCamelContextTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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.test.patterns; - -import org.apache.camel.builder.RouteBuilder; -import org.springframework.context.support.AbstractApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - - -public class DebugSpringCamelContextTest extends DebugSpringTest { - - @Override - protected RouteBuilder createRouteBuilder() throws Exception { - return new RouteBuilder() { - @Override - public void configure() throws Exception { - // there is no route to be used - } - }; - } - - @Override - protected AbstractApplicationContext createApplicationContext() { - return new ClassPathXmlApplicationContext("org/apache/camel/test/patterns/applicationContext.xml"); - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/DebugSpringTest.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/DebugSpringTest.java b/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/DebugSpringTest.java deleted file mode 100644 index 482e2ef..0000000 --- a/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/DebugSpringTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * 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.test.patterns; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.model.ProcessorDefinition; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Test; -import org.springframework.context.support.AbstractApplicationContext; -import org.springframework.context.support.GenericApplicationContext; - -public class DebugSpringTest extends CamelSpringTestSupport { - private boolean debugged; - - @Override - public boolean isUseDebugger() { - // must enable debugger - return true; - } - - @Override - protected void debugBefore(Exchange exchange, Processor processor, - ProcessorDefinition<?> definition, String id, String shortName) { - // this method is invoked before we are about to enter the given processor - // from your Java editor you can just add a breakpoint in the code line below - log.info("Before " + definition + " with body " + exchange.getIn().getBody()); - debugged = true; - } - - - @Test - public void testDebugger() throws Exception { - // set mock expectations - getMockEndpoint("mock:a").expectedMessageCount(1); - getMockEndpoint("mock:b").expectedMessageCount(1); - - // send a message - template.sendBody("direct:start", "World"); - - // assert mocks - assertMockEndpointsSatisfied(); - assertTrue("The debugger is not called!", debugged); - } - - @Override - protected RouteBuilder createRouteBuilder() throws Exception { - return new RouteBuilder() { - @Override - public void configure() throws Exception { - // this is the route we want to debug - from("direct:start") - .to("mock:a") - .transform(body().prepend("Hello ")) - .to("mock:b"); - } - }; - } - - - @Override - protected AbstractApplicationContext createApplicationContext() { - return new GenericApplicationContext(); - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/MyProduceBean.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/MyProduceBean.java b/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/MyProduceBean.java deleted file mode 100644 index 100b349..0000000 --- a/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/MyProduceBean.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * 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.test.patterns; - -import org.apache.camel.EndpointInject; -import org.apache.camel.Produce; -import org.apache.camel.ProducerTemplate; - -/** - * - */ -public class MyProduceBean { - - @Produce(uri = "mock:result") - MySender sender; - - @EndpointInject(uri = "direct:start") - ProducerTemplate template; - - public void doSomething(String body) { - sender.send(body); - } - - public ProducerTemplate getProducerTemplate() { - return template; - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/MySender.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/MySender.java b/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/MySender.java deleted file mode 100644 index e36c042..0000000 --- a/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/MySender.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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.test.patterns; - -/** - * - */ -public interface MySender { - - void send(String body); -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/ProduceBeanTest.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/ProduceBeanTest.java b/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/ProduceBeanTest.java deleted file mode 100644 index 5d9417f..0000000 --- a/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/ProduceBeanTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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.test.patterns; - -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.Test; -import org.springframework.context.support.AbstractApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -/** - * - */ -public class ProduceBeanTest extends CamelSpringTestSupport { - - @Test - public void testProduceBean() throws Exception { - getMockEndpoint("mock:result").expectedMessageCount(1); - - template.sendBody("direct:start", "Hello World"); - - assertMockEndpointsSatisfied(); - } - - @Override - protected AbstractApplicationContext createApplicationContext() { - return new ClassPathXmlApplicationContext("org/apache/camel/test/patterns/ProduceBeanTest.xml"); - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/ProducerBeanInjectTest.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/ProducerBeanInjectTest.java b/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/ProducerBeanInjectTest.java deleted file mode 100644 index fd794c6..0000000 --- a/components/camel-test-spring41/src/test/java/org/apache/camel/test/patterns/ProducerBeanInjectTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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.test.patterns; - -import org.junit.Assert; -import org.junit.Test; -import org.springframework.context.support.AbstractApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -public class ProducerBeanInjectTest extends Assert { - - @Test - public void checkProducerBeanInjection() { - AbstractApplicationContext applicationContext = createApplicationContext(); - MyProduceBean bean = applicationContext.getBean("myProduceBean", MyProduceBean.class); - assertNotNull("The producerTemplate should not be null.", bean.getProducerTemplate()); - assertEquals("Get a wrong response", "Camel rocks!", bean.getProducerTemplate().requestBody("Camel")); - } - - protected AbstractApplicationContext createApplicationContext() { - return new ClassPathXmlApplicationContext("org/apache/camel/test/patterns/ProduceBeanInjectTest.xml"); - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringActiveProfileTest.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringActiveProfileTest.java b/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringActiveProfileTest.java deleted file mode 100644 index 2478bf0..0000000 --- a/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringActiveProfileTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * 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.test.spring; - -import org.apache.camel.CamelContext; -import org.apache.camel.Produce; -import org.apache.camel.ProducerTemplate; -import org.apache.camel.component.mock.MockEndpoint; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.ContextConfiguration; - -// START SNIPPET: e1 - -/** - * Spring style testing with annotations to configure and setup the test. - * <p/> - * As we do next extend any base test class, we need to inject our resources - * for testing such as the {@link CamelContext} and {@link ProducerTemplate}. - */ -@ContextConfiguration -@ActiveProfiles("test") -@RunWith(CamelSpringJUnit4ClassRunner.class) -public class CamelSpringActiveProfileTest { - - @Autowired - protected CamelContext camelContext; - @Produce(uri = "direct:start", context = "camelContext") - protected ProducerTemplate start; - - @Test - public void testLoadActiveProfile() throws InterruptedException { - MockEndpoint mock = camelContext.getEndpoint("mock:test", MockEndpoint.class); - mock.expectedBodiesReceived("Hello World"); - start.sendBody("World"); - mock.assertIsSatisfied(); - } - -} -// END SNIPPET: e1 http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerDisableJmxInheritedOverrideTest.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerDisableJmxInheritedOverrideTest.java b/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerDisableJmxInheritedOverrideTest.java deleted file mode 100644 index 89c1105..0000000 --- a/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerDisableJmxInheritedOverrideTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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.test.spring; - -import org.apache.camel.management.DefaultManagementStrategy; - -import org.junit.Test; -import static org.junit.Assert.assertEquals; - -@DisableJmx -public class CamelSpringJUnit4ClassRunnerDisableJmxInheritedOverrideTest - extends CamelSpringJUnit4ClassRunnerDisableJmxTest { - - @Test - public void testJmx() throws Exception { - assertEquals(DefaultManagementStrategy.class, camelContext.getManagementStrategy().getClass()); - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerDisableJmxInheritedTest.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerDisableJmxInheritedTest.java b/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerDisableJmxInheritedTest.java deleted file mode 100644 index b0630e5..0000000 --- a/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerDisableJmxInheritedTest.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * 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.test.spring; - -public class CamelSpringJUnit4ClassRunnerDisableJmxInheritedTest - extends CamelSpringJUnit4ClassRunnerDisableJmxTest { -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerDisableJmxTest.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerDisableJmxTest.java b/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerDisableJmxTest.java deleted file mode 100644 index 67cfd7b..0000000 --- a/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerDisableJmxTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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.test.spring; - -import org.apache.camel.management.ManagedManagementStrategy; - -import org.junit.Test; -import static org.junit.Assert.assertEquals; - -@DisableJmx(false) -public class CamelSpringJUnit4ClassRunnerDisableJmxTest - extends CamelSpringJUnit4ClassRunnerPlainTest { - - @Test - @Override - public void testJmx() throws Exception { - assertEquals(ManagedManagementStrategy.class, camelContext.getManagementStrategy().getClass()); - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerExcludeRoutesTest.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerExcludeRoutesTest.java b/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerExcludeRoutesTest.java deleted file mode 100644 index 1d9d2ad..0000000 --- a/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerExcludeRoutesTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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.test.spring; - -import static org.junit.Assert.assertNull; - -@ExcludeRoutes(TestRouteBuilder.class) -public class CamelSpringJUnit4ClassRunnerExcludeRoutesTest - extends CamelSpringJUnit4ClassRunnerPlainTest { - - @Override - public void testExcludedRoute() { - assertNull(camelContext.getRoute("excludedRoute")); - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/7764c326/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerLazyLoadTypeConvertersInheritedOverrideTest.java ---------------------------------------------------------------------- diff --git a/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerLazyLoadTypeConvertersInheritedOverrideTest.java b/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerLazyLoadTypeConvertersInheritedOverrideTest.java deleted file mode 100644 index 37d2c1d..0000000 --- a/components/camel-test-spring41/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerLazyLoadTypeConvertersInheritedOverrideTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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.test.spring; - -import org.junit.Test; -import static org.junit.Assert.assertTrue; - -@SuppressWarnings("deprecation") -@LazyLoadTypeConverters(true) -public class CamelSpringJUnit4ClassRunnerLazyLoadTypeConvertersInheritedOverrideTest - extends CamelSpringJUnit4ClassRunnerLazyLoadTypeConvertersInheritedTest { - - @Test - @Override - public void testLazyLoadTypeConverters() { - assertTrue(camelContext.isLazyLoadTypeConverters()); - assertTrue(camelContext2.isLazyLoadTypeConverters()); - } -}
