This is an automated email from the ASF dual-hosted git repository. aldettinger pushed a commit to branch CAMEL-13965 in repository https://gitbox.apache.org/repos/asf/camel.git
commit 7292ede8e8c6f0b6d17df861612d1571bc7ca684 Author: aldettinger <aldettin...@gmail.com> AuthorDate: Wed Sep 11 10:32:49 2019 +0200 CAMEL-13965: Removed deprecated classes --- .../spring/CamelSpringBootJUnit4ClassRunner.java | 33 ----- .../CamelSpringDelegatingTestContextLoader.java | 138 --------------------- .../test/spring/CamelSpringJUnit4ClassRunner.java | 33 ----- .../{ => junit5}/CamelAnnotationsHandler.java | 0 .../CamelSpringBootExecutionListener.java | 0 .../spring/{ => junit5}/CamelSpringBootRunner.java | 0 .../spring/{ => junit5}/CamelSpringRunner.java | 0 .../{ => junit5}/CamelSpringTestContextLoader.java | 0 ...ringTestContextLoaderTestExecutionListener.java | 0 .../spring/{ => junit5}/CamelSpringTestHelper.java | 0 .../{ => junit5}/CamelSpringTestSupport.java | 0 .../{ => junit5}/CamelTestContextBootstrapper.java | 0 .../camel/test/spring/{ => junit5}/DisableJmx.java | 0 .../DisableJmxTestExecutionListener.java | 0 .../spring/{ => junit5}/EnableRouteCoverage.java | 0 .../test/spring/{ => junit5}/ExcludeRoutes.java | 0 .../test/spring/{ => junit5}/MockEndpoints.java | 0 .../spring/{ => junit5}/MockEndpointsAndSkip.java | 0 .../spring/{ => junit5}/ProvidesBreakpoint.java | 0 .../spring/{ => junit5}/RouteCoverageDumper.java | 0 .../{ => junit5}/RouteCoverageEventNotifier.java | 0 .../test/spring/{ => junit5}/ShutdownTimeout.java | 0 .../StopWatchTestExecutionListener.java | 0 .../test/spring/{ => junit5}/UseAdviceWith.java | 0 ...eOverridePropertiesWithPropertiesComponent.java | 0 25 files changed, 204 deletions(-) diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringBootJUnit4ClassRunner.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringBootJUnit4ClassRunner.java deleted file mode 100644 index e795918..0000000 --- a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringBootJUnit4ClassRunner.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.runners.model.InitializationError; - -/** - * The class {@link CamelSpringBootJUnit4ClassRunner} has been renamed to {@link CamelSpringBootRunner} - * which is a shorter and easier to remember name. - * - * @deprecated use {@link CamelSpringBootRunner} - */ -@Deprecated -public class CamelSpringBootJUnit4ClassRunner extends CamelSpringBootRunner { - - public CamelSpringBootJUnit4ClassRunner(Class<?> clazz) throws InitializationError { - super(clazz); - } -} diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringDelegatingTestContextLoader.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringDelegatingTestContextLoader.java deleted file mode 100644 index 3c22382..0000000 --- a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringDelegatingTestContextLoader.java +++ /dev/null @@ -1,138 +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 org.apache.camel.api.management.JmxSystemPropertyKeys; -import org.apache.camel.spring.SpringCamelContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.context.annotation.AnnotationConfigUtils; -import org.springframework.test.context.MergedContextConfiguration; -import org.springframework.test.context.support.DelegatingSmartContextLoader; - -/** - * CamelSpringDelegatingTestContextLoader which fixes issues in Camel's JavaConfigContextLoader. (adds support for Camel's test annotations) - * <br> - * <em>This loader can handle either classes or locations for configuring the context.</em> - * <br> - * NOTE: This TestContextLoader doesn't support the annotation of ExcludeRoutes now. - * - * @deprecated use {@link CamelSpringRunner} or {@link CamelSpringBootRunner} instead. - */ -@Deprecated -public class CamelSpringDelegatingTestContextLoader extends DelegatingSmartContextLoader { - - protected final Logger logger = LoggerFactory.getLogger(getClass()); - - @Override - public ApplicationContext loadContext(MergedContextConfiguration mergedConfig) throws Exception { - - Class<?> testClass = getTestClass(); - - if (logger.isDebugEnabled()) { - logger.debug("Loading ApplicationContext for merged context configuration [{}].", mergedConfig); - } - - // Pre CamelContext(s) instantiation setup - CamelAnnotationsHandler.handleDisableJmx(null, testClass); - - try { - SpringCamelContext.setNoStart(true); - System.setProperty("skipStartingCamelContext", "true"); - ConfigurableApplicationContext context = (ConfigurableApplicationContext) super.loadContext(mergedConfig); - SpringCamelContext.setNoStart(false); - System.clearProperty("skipStartingCamelContext"); - return loadContext(context, testClass); - } finally { - cleanup(testClass); - } - } - - /** - * Performs the bulk of the Spring application context loading/customization. - * - * @param context the partially configured context. The context should have the bean definitions loaded, but nothing else. - * @param testClass the test class being executed - * @return the initialized (refreshed) Spring application context - * - * @throws Exception if there is an error during initialization/customization - */ - public ApplicationContext loadContext(ConfigurableApplicationContext context, Class<?> testClass) - throws Exception { - - AnnotationConfigUtils.registerAnnotationConfigProcessors((BeanDefinitionRegistry) context); - - // Post CamelContext(s) instantiation but pre CamelContext(s) start setup - CamelAnnotationsHandler.handleRouteCoverage(context, testClass, s -> getTestMethod().getName()); - CamelAnnotationsHandler.handleProvidesBreakpoint(context, testClass); - CamelAnnotationsHandler.handleShutdownTimeout(context, testClass); - CamelAnnotationsHandler.handleMockEndpoints(context, testClass); - CamelAnnotationsHandler.handleMockEndpointsAndSkip(context, testClass); - CamelAnnotationsHandler.handleUseOverridePropertiesWithPropertiesComponent(context, testClass); - - // CamelContext(s) startup - CamelAnnotationsHandler.handleCamelContextStartup(context, testClass); - - return context; - } - - /** - * Cleanup/restore global state to defaults / pre-test values after the test setup - * is complete. - * - * @param testClass the test class being executed - */ - protected void cleanup(Class<?> testClass) { - SpringCamelContext.setNoStart(false); - - if (testClass.isAnnotationPresent(DisableJmx.class)) { - if (CamelSpringTestHelper.getOriginalJmxDisabled() == null) { - System.clearProperty(JmxSystemPropertyKeys.DISABLED); - } else { - System.setProperty(JmxSystemPropertyKeys.DISABLED, - CamelSpringTestHelper.getOriginalJmxDisabled()); - } - } - } - - /** - * Returns the class under test in order to enable inspection of annotations while the - * Spring context is being created. - * - * @return the test class that is being executed - * @see CamelSpringTestHelper - */ - protected Class<?> getTestClass() { - return CamelSpringTestHelper.getTestClass(); - } - - /** - * Returns the test method under test. - * - * @return the method that is being executed - * @see CamelSpringTestHelper - */ - protected Method getTestMethod() { - return CamelSpringTestHelper.getTestMethod(); - } - -} diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunner.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunner.java deleted file mode 100644 index 5cd2935..0000000 --- a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunner.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.runners.model.InitializationError; - -/** - * The class {@link CamelSpringJUnit4ClassRunner} has been renamed to {@link CamelSpringRunner} - * which is a shorter and easier to remember name. - * - * @deprecated use {@link CamelSpringRunner} - */ -@Deprecated -public class CamelSpringJUnit4ClassRunner extends CamelSpringRunner { - - public CamelSpringJUnit4ClassRunner(Class<?> clazz) throws InitializationError { - super(clazz); - } -} diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelAnnotationsHandler.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelAnnotationsHandler.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelAnnotationsHandler.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelAnnotationsHandler.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringBootExecutionListener.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringBootExecutionListener.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringBootExecutionListener.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringBootExecutionListener.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringBootRunner.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringBootRunner.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringBootRunner.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringBootRunner.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringRunner.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringRunner.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringRunner.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringRunner.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoader.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestContextLoader.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoader.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestContextLoader.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoaderTestExecutionListener.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestContextLoaderTestExecutionListener.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoaderTestExecutionListener.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestContextLoaderTestExecutionListener.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringTestHelper.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestHelper.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringTestHelper.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestHelper.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringTestSupport.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestSupport.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelSpringTestSupport.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestSupport.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelTestContextBootstrapper.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelTestContextBootstrapper.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/CamelTestContextBootstrapper.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelTestContextBootstrapper.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/DisableJmx.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/DisableJmx.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/DisableJmx.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/DisableJmx.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/DisableJmxTestExecutionListener.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/DisableJmxTestExecutionListener.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/DisableJmxTestExecutionListener.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/DisableJmxTestExecutionListener.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/EnableRouteCoverage.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/EnableRouteCoverage.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/EnableRouteCoverage.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/EnableRouteCoverage.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/ExcludeRoutes.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/ExcludeRoutes.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/ExcludeRoutes.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/ExcludeRoutes.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/MockEndpoints.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/MockEndpoints.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/MockEndpoints.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/MockEndpoints.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/MockEndpointsAndSkip.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/MockEndpointsAndSkip.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/MockEndpointsAndSkip.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/MockEndpointsAndSkip.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/ProvidesBreakpoint.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/ProvidesBreakpoint.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/ProvidesBreakpoint.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/ProvidesBreakpoint.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/RouteCoverageDumper.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/RouteCoverageDumper.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/RouteCoverageDumper.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/RouteCoverageDumper.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/RouteCoverageEventNotifier.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/RouteCoverageEventNotifier.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/RouteCoverageEventNotifier.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/RouteCoverageEventNotifier.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/ShutdownTimeout.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/ShutdownTimeout.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/ShutdownTimeout.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/ShutdownTimeout.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/StopWatchTestExecutionListener.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/StopWatchTestExecutionListener.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/StopWatchTestExecutionListener.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/StopWatchTestExecutionListener.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/UseAdviceWith.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/UseAdviceWith.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/UseAdviceWith.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/UseAdviceWith.java diff --git a/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/UseOverridePropertiesWithPropertiesComponent.java b/components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/UseOverridePropertiesWithPropertiesComponent.java similarity index 100% rename from components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/UseOverridePropertiesWithPropertiesComponent.java rename to components/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/UseOverridePropertiesWithPropertiesComponent.java