You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/10/08 12:02:55 UTC

[12/13] camel git commit: Lets rename @RouteCoverage to @EnableRouteCoverage as its easier to remember

Lets rename @RouteCoverage to @EnableRouteCoverage as its easier to remember


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/797b9f01
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/797b9f01
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/797b9f01

Branch: refs/heads/parser2
Commit: 797b9f0188e6e71209d74e7dec54ddee7daeae85
Parents: 75f2ba0
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Oct 8 13:38:50 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Oct 8 13:38:50 2017 +0200

----------------------------------------------------------------------
 .../test/spring/CamelAnnotationsHandler.java    |  2 +-
 .../spring/CamelSpringTestContextLoader.java    |  4 +-
 .../camel/test/spring/EnableRouteCoverage.java  | 39 ++++++++++++++++++++
 .../apache/camel/test/spring/RouteCoverage.java | 39 --------------------
 ...ringRouteProcessorDumpRouteCoverageTest.java |  2 +-
 .../java/sample/camel/FooApplicationTest.java   |  5 +--
 .../camel/SampleCamelApplicationTest.java       |  4 +-
 7 files changed, 47 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/797b9f01/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelAnnotationsHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelAnnotationsHandler.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelAnnotationsHandler.java
index 4b41e23..071891f 100644
--- a/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelAnnotationsHandler.java
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelAnnotationsHandler.java
@@ -78,7 +78,7 @@ public final class CamelAnnotationsHandler {
      * @param testClass the test class being executed
      */
     public static void handleRouteCoverage(ConfigurableApplicationContext context, Class<?> testClass, Function testMethod) throws Exception {
-        if (testClass.isAnnotationPresent(RouteCoverage.class)) {
+        if (testClass.isAnnotationPresent(EnableRouteCoverage.class)) {
             System.setProperty("CamelTestRouteCoverage", "true");
 
             CamelSpringTestHelper.doToSpringCamelContexts(context, new CamelSpringTestHelper.DoToSpringCamelContextsStrategy() {

http://git-wip-us.apache.org/repos/asf/camel/blob/797b9f01/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoader.java
----------------------------------------------------------------------
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoader.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoader.java
index 3323b9f..434f188 100644
--- a/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoader.java
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoader.java
@@ -268,7 +268,7 @@ public class CamelSpringTestContextLoader extends AbstractContextLoader {
                 LOG.info("Enabling Camel JMX as DisableJmx annotation was found and disableJmx is set to false.");
                 System.clearProperty(JmxSystemPropertyKeys.DISABLED);
             }
-        } else if (!testClass.isAnnotationPresent(RouteCoverage.class)) {
+        } else if (!testClass.isAnnotationPresent(EnableRouteCoverage.class)) {
             // route coverage need JMX so do not disable it by default
             LOG.info("Disabling Camel JMX globally for tests by default.  Use the DisableJMX annotation to override the default setting.");
             System.setProperty(JmxSystemPropertyKeys.DISABLED, "true");
@@ -282,7 +282,7 @@ public class CamelSpringTestContextLoader extends AbstractContextLoader {
      * @param testClass the test class being executed
      */
     private void handleRouteCoverage(GenericApplicationContext context, Class<?> testClass) throws Exception {
-        if (testClass.isAnnotationPresent(RouteCoverage.class)) {
+        if (testClass.isAnnotationPresent(EnableRouteCoverage.class)) {
             System.setProperty("CamelTestRouteCoverage", "true");
 
             CamelSpringTestHelper.doToSpringCamelContexts(context, new DoToSpringCamelContextsStrategy() {

http://git-wip-us.apache.org/repos/asf/camel/blob/797b9f01/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/EnableRouteCoverage.java
----------------------------------------------------------------------
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/EnableRouteCoverage.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/EnableRouteCoverage.java
new file mode 100644
index 0000000..13c8514
--- /dev/null
+++ b/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/EnableRouteCoverage.java
@@ -0,0 +1,39 @@
+/**
+ * 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;
+
+/**
+ * Enables dumping route coverage statistic.
+ * The route coverage status is written as xml files in the <tt>target/camel-route-coverage</tt> directory after the test has finished.
+ * <p/>
+ * This allows tooling or manual inspection of the stats, so you can generate a route trace diagram of which EIPs
+ * have been in use and which have not. Similar concepts as a code coverage report.
+ */
+@Documented
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+public @interface EnableRouteCoverage {
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/797b9f01/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/RouteCoverage.java
----------------------------------------------------------------------
diff --git a/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/RouteCoverage.java b/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/RouteCoverage.java
deleted file mode 100644
index df92663..0000000
--- a/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/RouteCoverage.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 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;
-
-/**
- * Enables dumping route coverage statistic.
- * The route coverage status is written as xml files in the <tt>target/camel-route-coverage</tt> directory after the test has finished.
- * <p/>
- * This allows tooling or manual inspection of the stats, so you can generate a route trace diagram of which EIPs
- * have been in use and which have not. Similar concepts as a code coverage report.
- */
-@Documented
-@Inherited
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE})
-public @interface RouteCoverage {
-
-}

http://git-wip-us.apache.org/repos/asf/camel/blob/797b9f01/components/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringRouteProcessorDumpRouteCoverageTest.java
----------------------------------------------------------------------
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringRouteProcessorDumpRouteCoverageTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringRouteProcessorDumpRouteCoverageTest.java
index b910e7b..9374d2f 100644
--- a/components/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringRouteProcessorDumpRouteCoverageTest.java
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringRouteProcessorDumpRouteCoverageTest.java
@@ -27,7 +27,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
-@RouteCoverage
+@EnableRouteCoverage
 public class CamelSpringRouteProcessorDumpRouteCoverageTest extends CamelSpringRunnerPlainTest {
 
     @BeforeClass

http://git-wip-us.apache.org/repos/asf/camel/blob/797b9f01/examples/camel-example-spring-boot/src/test/java/sample/camel/FooApplicationTest.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-boot/src/test/java/sample/camel/FooApplicationTest.java b/examples/camel-example-spring-boot/src/test/java/sample/camel/FooApplicationTest.java
index 0b76960..48aaf29 100644
--- a/examples/camel-example-spring-boot/src/test/java/sample/camel/FooApplicationTest.java
+++ b/examples/camel-example-spring-boot/src/test/java/sample/camel/FooApplicationTest.java
@@ -21,20 +21,19 @@ import java.util.concurrent.TimeUnit;
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.NotifyBuilder;
 import org.apache.camel.test.spring.CamelSpringBootRunner;
-import org.apache.camel.test.spring.RouteCoverage;
+import org.apache.camel.test.spring.EnableRouteCoverage;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.context.annotation.Configuration;
 
 import static org.junit.Assert.assertTrue;
 
 @RunWith(CamelSpringBootRunner.class)
 @SpringBootTest(classes = SampleCamelApplication.class,
     properties = "greeting = Hell foo")
-@RouteCoverage
+@EnableRouteCoverage
 @Ignore
 public class FooApplicationTest {
 

http://git-wip-us.apache.org/repos/asf/camel/blob/797b9f01/examples/camel-example-spring-boot/src/test/java/sample/camel/SampleCamelApplicationTest.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-boot/src/test/java/sample/camel/SampleCamelApplicationTest.java b/examples/camel-example-spring-boot/src/test/java/sample/camel/SampleCamelApplicationTest.java
index 94dc75b..f4c2fc5 100644
--- a/examples/camel-example-spring-boot/src/test/java/sample/camel/SampleCamelApplicationTest.java
+++ b/examples/camel-example-spring-boot/src/test/java/sample/camel/SampleCamelApplicationTest.java
@@ -21,7 +21,7 @@ import java.util.concurrent.TimeUnit;
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.NotifyBuilder;
 import org.apache.camel.test.spring.CamelSpringBootRunner;
-import org.apache.camel.test.spring.RouteCoverage;
+import org.apache.camel.test.spring.EnableRouteCoverage;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,7 +31,7 @@ import static org.junit.Assert.assertTrue;
 
 @RunWith(CamelSpringBootRunner.class)
 @SpringBootTest(classes = SampleCamelApplication.class)
-@RouteCoverage
+@EnableRouteCoverage
 public class SampleCamelApplicationTest {
 
     @Autowired