camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/3] git commit: CAMEL-7030: quartz components now register the quartz scheduler in JMX by default, unless configured not to do so by end user. Fixed route policy tests using custom date type instead of using the java.util.Date.
Date Tue, 03 Dec 2013 09:47:30 GMT
CAMEL-7030: quartz components now register the quartz scheduler in JMX by default, unless configured not to do so by end user. Fixed route policy tests using custom date type instead of using the java.util.Date.


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

Branch: refs/heads/master
Commit: 31b419c9d4959a98b1ad99dae6952cdf384f1798
Parents: 125d751
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Dec 3 10:49:27 2013 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Dec 3 10:49:50 2013 +0100

----------------------------------------------------------------------
 .../camel/component/quartz/QuartzComponent.java | 19 ++++++
 .../camel/component/quartz/BaseQuartzTest.java  | 38 +++++++++++
 .../quartz/QuartUnderscoreTimerNameTest.java    |  3 +-
 .../quartz/QuartzAddDynamicRouteTest.java       |  3 +-
 ...tzAddRoutesAfterCamelContextStartedTest.java |  3 +-
 .../component/quartz/QuartzAutoStartTest.java   |  3 +-
 .../component/quartz/QuartzComponentTest.java   |  3 +-
 .../component/quartz/QuartzCronRouteTest.java   |  3 +-
 .../QuartzCronRouteWithSmallCacheTest.java      |  3 +-
 .../quartz/QuartzEndpointConfigureTest.java     |  3 +-
 .../quartz/QuartzJobRouteUnderscoreTest.java    |  3 +-
 .../component/quartz/QuartzManagementTest.java  | 72 ++++++++++++++++++++
 .../component/quartz/QuartzPropertiesTest.java  |  3 +-
 .../quartz/QuartzRouteRestartTest.java          |  3 +-
 .../camel/component/quartz/QuartzRouteTest.java |  3 +-
 .../quartz/QuartzStartDelayedOptionTest.java    |  3 +-
 .../quartz/QuartzStartDelayedTest.java          |  3 +-
 .../component/quartz/QuartzStopRouteTest.java   |  3 +-
 .../quartz/QuartzSuspendRouteTest.java          |  3 +-
 .../quartz/StatefulQuartzRouteTest.java         |  3 +-
 .../camel/routepolicy/quartz/DateFactory.java   | 29 ++++++++
 .../camel/routepolicy/quartz/SimpleDate.java    | 33 ---------
 .../camel/routepolicy/quartz/CronPolicies.xml   | 50 +++++++-------
 .../routepolicy/quartz/MultiplePolicies.xml     | 36 +++++-----
 .../camel/routepolicy/quartz/SimplePolicies.xml | 12 ++--
 .../component/quartz2/QuartzComponent.java      | 28 +++++++-
 .../camel/component/quartz2/BaseQuartzTest.java | 38 +++++++++++
 .../quartz2/QuartUnderscoreTimerNameTest.java   |  3 +-
 .../quartz2/QuartzAddDynamicRouteTest.java      |  3 +-
 ...tzAddRoutesAfterCamelContextStartedTest.java |  3 +-
 .../component/quartz2/QuartzAutoStartTest.java  |  3 +-
 .../component/quartz2/QuartzComponentTest.java  |  3 +-
 .../component/quartz2/QuartzCronRouteTest.java  |  3 +-
 .../QuartzCronRouteWithSmallCacheTest.java      |  3 +-
 .../quartz2/QuartzEndpointConfigureTest.java    |  3 +-
 .../quartz2/QuartzJobRouteUnderscoreTest.java   |  3 +-
 .../component/quartz2/QuartzManagementTest.java | 72 ++++++++++++++++++++
 .../component/quartz2/QuartzPropertiesTest.java |  3 +-
 .../quartz2/QuartzRepeatIntervalTest.java       |  3 +-
 .../quartz2/QuartzRouteFireNowTest.java         |  2 +-
 .../quartz2/QuartzRouteRestartTest.java         |  3 +-
 .../component/quartz2/QuartzRouteTest.java      |  3 +-
 .../quartz2/QuartzSimpleRouteTest.java          |  3 +-
 .../quartz2/QuartzStartDelayedOptionTest.java   |  3 +-
 .../quartz2/QuartzStartDelayedTest.java         |  3 +-
 .../quartz2/QuartzStatefulJobRouteTest.java     |  4 +-
 .../component/quartz2/QuartzStopRouteTest.java  |  3 +-
 .../quartz2/QuartzSuspendRouteTest.java         |  3 +-
 .../quartz2/StatefulQuartzRouteTest.java        |  3 +-
 .../camel/routepolicy/quartz2/DateFactory.java  | 30 ++++++++
 .../camel/routepolicy/quartz2/SimpleDate.java   | 33 ---------
 .../camel/routepolicy/quartz2/CronPolicies.xml  | 50 +++++++-------
 .../routepolicy/quartz2/MultiplePolicies.xml    | 36 +++++-----
 .../routepolicy/quartz2/SimplePolicies.xml      | 70 ++++++++++---------
 54 files changed, 492 insertions(+), 268 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
index 0ea7a85..51fea39 100644
--- a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
+++ b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
@@ -60,6 +60,7 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
     private String propertiesFile;
     private int startDelayedSeconds;
     private boolean autoStartScheduler = true;
+    private boolean enableJmx = true;
 
     private static final class JobToAdd {
         private final JobDetail job;
@@ -410,6 +411,14 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
         this.autoStartScheduler = autoStartScheduler;
     }
 
+    public boolean isEnableJmx() {
+        return enableJmx;
+    }
+
+    public void setEnableJmx(boolean enableJmx) {
+        this.enableJmx = enableJmx;
+    }
+
     // Implementation methods
     // -------------------------------------------------------------------------
 
@@ -440,6 +449,11 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
             // force disabling update checker (will do online check over the internet)
             prop.put("org.quartz.scheduler.skipUpdateCheck", "true");
 
+            // enable jmx unless configured to not do so
+            if (enableJmx && !prop.containsKey("org.quartz.scheduler.jmx.export")) {
+                prop.put("org.quartz.scheduler.jmx.export", "true");
+            }
+
             answer = new StdSchedulerFactory(prop);
         } else {
             // read default props to be able to use a single scheduler per camel context
@@ -472,6 +486,11 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
             // force disabling update checker (will do online check over the internet)
             prop.put("org.quartz.scheduler.skipUpdateCheck", "true");
 
+            // enable jmx unless configured to not do so
+            if (enableJmx && !prop.containsKey("org.quartz.scheduler.jmx.export")) {
+                prop.put("org.quartz.scheduler.jmx.export", "true");
+            }
+
             answer = new StdSchedulerFactory(prop);
         }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/BaseQuartzTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/BaseQuartzTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/BaseQuartzTest.java
new file mode 100644
index 0000000..512d48b
--- /dev/null
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/BaseQuartzTest.java
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.quartz;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.test.junit4.CamelTestSupport;
+
+public class BaseQuartzTest extends CamelTestSupport {
+
+    protected boolean isEnableJmx() {
+        return true;
+    }
+
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        CamelContext context = super.createCamelContext();
+
+        QuartzComponent quartz = context.getComponent("quartz", QuartzComponent.class);
+        quartz.setEnableJmx(isEnableJmx());
+
+        return context;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartUnderscoreTimerNameTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartUnderscoreTimerNameTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartUnderscoreTimerNameTest.java
index de05229..b569319 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartUnderscoreTimerNameTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartUnderscoreTimerNameTest.java
@@ -18,10 +18,9 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
-public class QuartUnderscoreTimerNameTest extends CamelTestSupport {
+public class QuartUnderscoreTimerNameTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzCronRouteUnderscore() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddDynamicRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddDynamicRouteTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddDynamicRouteTest.java
index 267203c..00bffec 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddDynamicRouteTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddDynamicRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzAddDynamicRouteTest extends CamelTestSupport {
+public class QuartzAddDynamicRouteTest extends BaseQuartzTest {
     protected MockEndpoint resultEndpoint;
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddRoutesAfterCamelContextStartedTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddRoutesAfterCamelContextStartedTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddRoutesAfterCamelContextStartedTest.java
index 9a14753..1a03af9 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddRoutesAfterCamelContextStartedTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddRoutesAfterCamelContextStartedTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzAddRoutesAfterCamelContextStartedTest extends CamelTestSupport {
+public class QuartzAddRoutesAfterCamelContextStartedTest extends BaseQuartzTest {
 
     @Test
     public void testAddRoutes() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAutoStartTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAutoStartTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAutoStartTest.java
index fab17a4..99aff2c 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAutoStartTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAutoStartTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzAutoStartTest extends CamelTestSupport {
+public class QuartzAutoStartTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzAutoStart() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzComponentTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzComponentTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzComponentTest.java
index aa66416..d77dc32 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzComponentTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzComponentTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.quartz;
 
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.quartz.Scheduler;
 import org.quartz.SchedulerFactory;
@@ -25,7 +24,7 @@ import org.quartz.impl.StdSchedulerFactory;
 /**
  * @version 
  */
-public class QuartzComponentTest extends CamelTestSupport {
+public class QuartzComponentTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzComponentCustomScheduler() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteTest.java
index 5ad38a5..22d2b4c 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzCronRouteTest extends CamelTestSupport {
+public class QuartzCronRouteTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzCronRoute() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteWithSmallCacheTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteWithSmallCacheTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteWithSmallCacheTest.java
index 21cbc2e..02090dd 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteWithSmallCacheTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteWithSmallCacheTest.java
@@ -23,7 +23,6 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
@@ -32,7 +31,7 @@ import org.junit.Test;
  * <p/>
  * We simulate this behavior with a capacity of 1 element.
  */
-public class QuartzCronRouteWithSmallCacheTest extends CamelTestSupport {
+public class QuartzCronRouteWithSmallCacheTest extends BaseQuartzTest {
 
     private final CountDownLatch latch = new CountDownLatch(3);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzEndpointConfigureTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzEndpointConfigureTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzEndpointConfigureTest.java
index 234a955..b338cd6 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzEndpointConfigureTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzEndpointConfigureTest.java
@@ -17,7 +17,6 @@
 package org.apache.camel.component.quartz;
 
 import org.apache.camel.Endpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.quartz.CronTrigger;
 import org.quartz.SimpleTrigger;
@@ -26,7 +25,7 @@ import org.quartz.Trigger;
 /**
  * @version 
  */
-public class QuartzEndpointConfigureTest extends CamelTestSupport {
+public class QuartzEndpointConfigureTest extends BaseQuartzTest {
 
     @Test
     public void testConfigureGroupAndName() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzJobRouteUnderscoreTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzJobRouteUnderscoreTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzJobRouteUnderscoreTest.java
index 0094d91..70e6dff 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzJobRouteUnderscoreTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzJobRouteUnderscoreTest.java
@@ -18,14 +18,13 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.quartz.JobDetail;
 
 /**
  * @version 
  */
-public class QuartzJobRouteUnderscoreTest extends CamelTestSupport {
+public class QuartzJobRouteUnderscoreTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzRoute() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzManagementTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzManagementTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzManagementTest.java
new file mode 100644
index 0000000..b428fed
--- /dev/null
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzManagementTest.java
@@ -0,0 +1,72 @@
+/**
+ * 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.component.quartz;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.Test;
+
+public class QuartzManagementTest extends BaseQuartzTest {
+
+    @Override
+    protected boolean useJmx() {
+        return true;
+    }
+
+    @Override
+    protected boolean isEnableJmx() {
+        return true;
+    }
+
+    protected MBeanServer getMBeanServer() {
+        return context.getManagementStrategy().getManagementAgent().getMBeanServer();
+    }
+
+    @Test
+    public void testQuartzRoute() throws Exception {
+        // JMX tests dont work well on AIX CI servers (hangs them)
+        if (isPlatform("aix")) {
+            return;
+        }
+
+        getMockEndpoint("mock:result").expectedMessageCount(2);
+
+        assertMockEndpointsSatisfied();
+
+        MBeanServer mbeanServer = getMBeanServer();
+
+        String name = String.format("quartz:type=QuartzScheduler,name=DefaultQuartzScheduler-%s,instance=NON_CLUSTERED", context.getManagementName());
+
+        ObjectName on = ObjectName.getInstance(name);
+        assertTrue(mbeanServer.isRegistered(on));
+
+        Boolean started = (Boolean) mbeanServer.getAttribute(on, "Started");
+        assertEquals(true, started);
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("quartz://myGroup/myTimerName?trigger.repeatInterval=2&trigger.repeatCount=1").routeId("myRoute").to("mock:result");
+            }
+        };
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzPropertiesTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzPropertiesTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzPropertiesTest.java
index e663232..4fa0705 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzPropertiesTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzPropertiesTest.java
@@ -19,14 +19,13 @@ package org.apache.camel.component.quartz;
 import java.io.InputStream;
 import java.util.Properties;
 
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.quartz.SchedulerException;
 
 /**
  * @version 
  */
-public class QuartzPropertiesTest extends CamelTestSupport {
+public class QuartzPropertiesTest extends BaseQuartzTest {
 
     private QuartzComponent quartz;
 

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteRestartTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteRestartTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteRestartTest.java
index aa68e74..312efdd 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteRestartTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteRestartTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzRouteRestartTest extends CamelTestSupport {
+public class QuartzRouteRestartTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzCronRoute() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteTest.java
index 88e51fa..5329e81 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzRouteTest extends CamelTestSupport {
+public class QuartzRouteTest extends BaseQuartzTest {
     protected MockEndpoint resultEndpoint;
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedOptionTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedOptionTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedOptionTest.java
index 1e65965..04ed797 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedOptionTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedOptionTest.java
@@ -18,10 +18,9 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
-public class QuartzStartDelayedOptionTest extends CamelTestSupport {
+public class QuartzStartDelayedOptionTest extends BaseQuartzTest {
 
     @Test
     public void testStartDelayed() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedTest.java
index c9d56e5..b714c6c 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedTest.java
@@ -18,10 +18,9 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
-public class QuartzStartDelayedTest extends CamelTestSupport {
+public class QuartzStartDelayedTest extends BaseQuartzTest {
 
     @Test
     public void testStartDelayed() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStopRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStopRouteTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStopRouteTest.java
index 6fd3da3..5f3d4c60 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStopRouteTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStopRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzStopRouteTest extends CamelTestSupport {
+public class QuartzStopRouteTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzStop() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzSuspendRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzSuspendRouteTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzSuspendRouteTest.java
index 3632cbc..145f9b8 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzSuspendRouteTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzSuspendRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzSuspendRouteTest extends CamelTestSupport {
+public class QuartzSuspendRouteTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzSuspend() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java
index 19e6cc1..aecd360 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java
@@ -22,13 +22,12 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class StatefulQuartzRouteTest extends CamelTestSupport {
+public class StatefulQuartzRouteTest extends BaseQuartzTest {
     protected MockEndpoint resultEndpoint;
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/DateFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/DateFactory.java b/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/DateFactory.java
new file mode 100644
index 0000000..87f8e52
--- /dev/null
+++ b/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/DateFactory.java
@@ -0,0 +1,29 @@
+/**
+ * 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.routepolicy.quartz;
+
+import java.util.Date;
+
+public final class DateFactory {
+
+    private DateFactory() {
+    }
+
+    public static Date createDate(int future) {
+        return new Date(System.currentTimeMillis() + future);
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SimpleDate.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SimpleDate.java b/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SimpleDate.java
deleted file mode 100644
index 5cf9f43..0000000
--- a/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SimpleDate.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.routepolicy.quartz;
-
-import java.util.Date;
-
-public class SimpleDate extends Date {
-
-    private static final long serialVersionUID = 1L;
-
-    public SimpleDate() {
-        this(3000);
-    }
-
-    public SimpleDate(long milliseconds) {
-        super(System.currentTimeMillis() + milliseconds);
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/CronPolicies.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/CronPolicies.xml b/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/CronPolicies.xml
index b0ad234..8fc9e6b 100644
--- a/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/CronPolicies.xml
+++ b/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/CronPolicies.xml
@@ -22,31 +22,29 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <bean id="date" class="org.apache.camel.routepolicy.quartz.SimpleDate"/>
-
-    <bean id="defaultPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy"/>
-
-    <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
-    	<property name="routeStartTime" value="*/3 * * * * ?"/>
-    </bean>
-    
-    <bean id="stopPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
-    	<property name="routeStopTime" value="*/3 * * * * ?"/>
-	</bean>
-	
-	<bean id="suspendPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
-    	<property name="routeSuspendTime" value="*/3 * * * * ?"/>
-  	</bean>
-  	
-  	<bean id="resumePolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
-    	<property name="routeResumeTime" value="*/3 * * * * ?"/>
- 	</bean> 
- 	
-    <routeContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
-        <route id="testRoute">
-            <from uri="direct:start"/>
-            <to uri="mock:success"/>
-        </route>
-    </routeContext>
+  <bean id="defaultPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy"/>
+
+  <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
+    <property name="routeStartTime" value="*/3 * * * * ?"/>
+  </bean>
+
+  <bean id="stopPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
+    <property name="routeStopTime" value="*/3 * * * * ?"/>
+  </bean>
+
+  <bean id="suspendPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
+    <property name="routeSuspendTime" value="*/3 * * * * ?"/>
+  </bean>
+
+  <bean id="resumePolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
+    <property name="routeResumeTime" value="*/3 * * * * ?"/>
+  </bean>
+
+  <routeContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
+    <route id="testRoute">
+      <from uri="direct:start"/>
+      <to uri="mock:success"/>
+    </route>
+  </routeContext>
 
 </beans>

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/MultiplePolicies.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/MultiplePolicies.xml b/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/MultiplePolicies.xml
index 09b2ba3..52c1832 100644
--- a/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/MultiplePolicies.xml
+++ b/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/MultiplePolicies.xml
@@ -22,23 +22,25 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <bean id="date" class="org.apache.camel.routepolicy.quartz.SimpleDate"/>
+  <bean id="now" class="org.apache.camel.routepolicy.quartz.DateFactory" factory-method="createDate">
+    <constructor-arg index="0" value="3000"/>
+  </bean>
 
-    <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz.SimpleScheduledRoutePolicy">
-    	<property name="routeStartDate" ref="date"/>
-    	<property name="routeStartRepeatCount" value="1"/>
-    	<property name="routeStartRepeatInterval" value="3000"/>    	
-    </bean>
-    
-    <bean id="throttlePolicy" class="org.apache.camel.impl.ThrottlingInflightRoutePolicy">
-    	<property name="maxInflightExchanges" value="10"/>    	
-	</bean>
-	 	
-    <camelContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
-        <route id="testRoute" autoStartup="false" routePolicyRef="startPolicy, throttlePolicy">
-            <from uri="seda:foo?concurrentConsumers=20"/>
-            <to uri="mock:success"/>
-        </route>
-    </camelContext>
+  <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz.SimpleScheduledRoutePolicy">
+    <property name="routeStartDate" ref="now"/>
+    <property name="routeStartRepeatCount" value="-1"/>
+    <property name="routeStartRepeatInterval" value="3000"/>
+  </bean>
+
+  <bean id="throttlePolicy" class="org.apache.camel.impl.ThrottlingInflightRoutePolicy">
+    <property name="maxInflightExchanges" value="10"/>
+  </bean>
+
+  <camelContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
+    <route id="testRoute" autoStartup="false" routePolicyRef="startPolicy, throttlePolicy">
+      <from uri="seda:foo?concurrentConsumers=20"/>
+      <to uri="mock:success"/>
+    </route>
+  </camelContext>
 
 </beans>

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SimplePolicies.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SimplePolicies.xml b/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SimplePolicies.xml
index e87b0b9..f07eabd 100644
--- a/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SimplePolicies.xml
+++ b/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SimplePolicies.xml
@@ -22,30 +22,32 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <bean id="date" class="org.apache.camel.routepolicy.quartz.SimpleDate"/>
+    <bean id="now" class="org.apache.camel.routepolicy.quartz.DateFactory" factory-method="createDate">
+      <constructor-arg index="0" value="3000"/>
+    </bean>
 
     <bean id="defaultPolicy" class="org.apache.camel.routepolicy.quartz.SimpleScheduledRoutePolicy"/>
 
     <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz.SimpleScheduledRoutePolicy">
-    	<property name="routeStartDate" ref="date"/>
+    	<property name="routeStartDate" ref="now"/>
     	<property name="routeStartRepeatCount" value="1"/>
     	<property name="routeStartRepeatInterval" value="3000"/>    	
     </bean>
     
     <bean id="stopPolicy" class="org.apache.camel.routepolicy.quartz.SimpleScheduledRoutePolicy">
-    	<property name="routeStopDate" ref="date"/>
+    	<property name="routeStopDate" ref="now"/>
     	<property name="routeStopRepeatCount" value="1"/>
     	<property name="routeStopRepeatInterval" value="3000"/>    	
 	</bean>
 	
 	<bean id="suspendPolicy" class="org.apache.camel.routepolicy.quartz.SimpleScheduledRoutePolicy">
-    	<property name="routeSuspendDate" ref="date"/>
+    	<property name="routeSuspendDate" ref="now"/>
     	<property name="routeSuspendRepeatCount" value="1"/>
     	<property name="routeSuspendRepeatInterval" value="3000"/>    	
   	</bean>
   	
   	<bean id="resumePolicy" class="org.apache.camel.routepolicy.quartz.SimpleScheduledRoutePolicy">
-       	<property name="routeResumeDate" ref="date"/>
+       	<property name="routeResumeDate" ref="now"/>
     	<property name="routeResumeRepeatCount" value="1"/>
     	<property name="routeResumeRepeatInterval" value="3000"/>    	
  	</bean> 

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
index 701b966..3305310 100644
--- a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
+++ b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
@@ -45,7 +45,6 @@ import org.slf4j.LoggerFactory;
  * <p>This component uses Quartz 2.x API and provide all the features from "camel-quartz". It has reused some
  * of the code, but mostly has been re-written in attempt to be more easier to maintain, and use Quartz more
  * fully.</p>
- *
  */
 public class QuartzComponent extends DefaultComponent implements StartupListener {
     private static final Logger LOG = LoggerFactory.getLogger(QuartzComponent.class);
@@ -56,6 +55,7 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
     private int startDelayedSeconds;
     private boolean autoStartScheduler = true;
     private boolean prefixJobNameWithEndpointId;
+    private boolean enableJmx = true;
 
     public QuartzComponent() {
     }
@@ -80,6 +80,22 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
         this.autoStartScheduler = autoStartScheduler;
     }
 
+    public boolean isPrefixJobNameWithEndpointId() {
+        return prefixJobNameWithEndpointId;
+    }
+
+    public void setPrefixJobNameWithEndpointId(boolean prefixJobNameWithEndpointId) {
+        this.prefixJobNameWithEndpointId = prefixJobNameWithEndpointId;
+    }
+
+    public boolean isEnableJmx() {
+        return enableJmx;
+    }
+
+    public void setEnableJmx(boolean enableJmx) {
+        this.enableJmx = enableJmx;
+    }
+
     public Properties getProperties() {
         return properties;
     }
@@ -113,6 +129,11 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
             prop.put("org.quartz.scheduler.skipUpdateCheck", "true");
             prop.put("org.terracotta.quartz.skipUpdateCheck", "true");
 
+            // enable jmx unless configured to not do so
+            if (enableJmx && !prop.containsKey("org.quartz.scheduler.jmx.export")) {
+                prop.put("org.quartz.scheduler.jmx.export", "true");
+            }
+
             answer = new StdSchedulerFactory(prop);
         } else {
             // read default props to be able to use a single scheduler per camel context
@@ -146,6 +167,11 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
             prop.put("org.quartz.scheduler.skipUpdateCheck", "true");
             prop.put("org.terracotta.quartz.skipUpdateCheck=true", "true");
 
+            // enable jmx unless configured to not do so
+            if (enableJmx && !prop.containsKey("org.quartz.scheduler.jmx.export")) {
+                prop.put("org.quartz.scheduler.jmx.export", "true");
+            }
+
             answer = new StdSchedulerFactory(prop);
         }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/BaseQuartzTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/BaseQuartzTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/BaseQuartzTest.java
new file mode 100644
index 0000000..178a11a
--- /dev/null
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/BaseQuartzTest.java
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.quartz2;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.test.junit4.CamelTestSupport;
+
+public class BaseQuartzTest extends CamelTestSupport {
+
+    protected boolean isEnableJmx() {
+        return true;
+    }
+
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        CamelContext context = super.createCamelContext();
+
+        QuartzComponent quartz = context.getComponent("quartz2", QuartzComponent.class);
+        quartz.setEnableJmx(isEnableJmx());
+
+        return context;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartUnderscoreTimerNameTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartUnderscoreTimerNameTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartUnderscoreTimerNameTest.java
index d7d6c99..7b0c7a1 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartUnderscoreTimerNameTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartUnderscoreTimerNameTest.java
@@ -18,10 +18,9 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
-public class QuartUnderscoreTimerNameTest extends CamelTestSupport {
+public class QuartUnderscoreTimerNameTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzCronRouteUnderscore() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddDynamicRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddDynamicRouteTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddDynamicRouteTest.java
index 05bb827..914a5af 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddDynamicRouteTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddDynamicRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzAddDynamicRouteTest extends CamelTestSupport {
+public class QuartzAddDynamicRouteTest extends BaseQuartzTest {
     protected MockEndpoint resultEndpoint;
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddRoutesAfterCamelContextStartedTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddRoutesAfterCamelContextStartedTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddRoutesAfterCamelContextStartedTest.java
index 1f11d23..65f33b8 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddRoutesAfterCamelContextStartedTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddRoutesAfterCamelContextStartedTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzAddRoutesAfterCamelContextStartedTest extends CamelTestSupport {
+public class QuartzAddRoutesAfterCamelContextStartedTest extends BaseQuartzTest {
 
     @Test
     public void testAddRoutes() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAutoStartTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAutoStartTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAutoStartTest.java
index e330413..a05a7d8 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAutoStartTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAutoStartTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzAutoStartTest extends CamelTestSupport {
+public class QuartzAutoStartTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzAutoStart() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzComponentTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzComponentTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzComponentTest.java
index a24b529..d3ece01 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzComponentTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzComponentTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.quartz2;
 
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.quartz.Scheduler;
 import org.quartz.SchedulerFactory;
@@ -25,7 +24,7 @@ import org.quartz.impl.StdSchedulerFactory;
 /**
  * @version 
  */
-public class QuartzComponentTest extends CamelTestSupport {
+public class QuartzComponentTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzComponentCustomScheduler() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteTest.java
index 9b2225b..34b7c85 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteTest.java
@@ -18,7 +18,6 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.hamcrest.CoreMatchers;
 import org.junit.Assert;
 import org.junit.Test;
@@ -30,7 +29,7 @@ import org.quartz.Trigger;
  * This test the  CronTrigger as a timer endpoint in a route.
  * @version 
  */
-public class QuartzCronRouteTest extends CamelTestSupport {
+public class QuartzCronRouteTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzCronRoute() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteWithSmallCacheTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteWithSmallCacheTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteWithSmallCacheTest.java
index 2e2cbd0..5a0d5c1 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteWithSmallCacheTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteWithSmallCacheTest.java
@@ -23,7 +23,6 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
@@ -32,7 +31,7 @@ import org.junit.Test;
  * <p/>
  * We simulate this behavior with a capacity of 1 element.
  */
-public class QuartzCronRouteWithSmallCacheTest extends CamelTestSupport {
+public class QuartzCronRouteWithSmallCacheTest extends BaseQuartzTest {
 
     private final CountDownLatch latch = new CountDownLatch(3);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzEndpointConfigureTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzEndpointConfigureTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzEndpointConfigureTest.java
index c2fea04..13f94ce 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzEndpointConfigureTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzEndpointConfigureTest.java
@@ -17,7 +17,6 @@
 package org.apache.camel.component.quartz2;
 
 import org.apache.camel.Endpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.quartz.CronTrigger;
 import org.quartz.JobDetail;
@@ -30,7 +29,7 @@ import org.quartz.TriggerKey;
 /**
  * @version 
  */
-public class QuartzEndpointConfigureTest extends CamelTestSupport {
+public class QuartzEndpointConfigureTest extends BaseQuartzTest {
 
     @Test
     public void testConfigureGroupAndName() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzJobRouteUnderscoreTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzJobRouteUnderscoreTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzJobRouteUnderscoreTest.java
index d2e440c..5edd99f 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzJobRouteUnderscoreTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzJobRouteUnderscoreTest.java
@@ -18,14 +18,13 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.quartz.JobDetail;
 
 /**
  * @version 
  */
-public class QuartzJobRouteUnderscoreTest extends CamelTestSupport {
+public class QuartzJobRouteUnderscoreTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzRoute() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzManagementTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzManagementTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzManagementTest.java
new file mode 100644
index 0000000..b65820a
--- /dev/null
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzManagementTest.java
@@ -0,0 +1,72 @@
+/**
+ * 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.component.quartz2;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.Test;
+
+public class QuartzManagementTest extends BaseQuartzTest {
+
+    @Override
+    protected boolean useJmx() {
+        return true;
+    }
+
+    @Override
+    protected boolean isEnableJmx() {
+        return true;
+    }
+
+    protected MBeanServer getMBeanServer() {
+        return context.getManagementStrategy().getManagementAgent().getMBeanServer();
+    }
+
+    @Test
+    public void testQuartzRoute() throws Exception {
+        // JMX tests dont work well on AIX CI servers (hangs them)
+        if (isPlatform("aix")) {
+            return;
+        }
+
+        getMockEndpoint("mock:result").expectedMessageCount(2);
+
+        assertMockEndpointsSatisfied();
+
+        MBeanServer mbeanServer = getMBeanServer();
+
+        String name = String.format("quartz:type=QuartzScheduler,name=DefaultQuartzScheduler-%s,instance=NON_CLUSTERED", context.getManagementName());
+
+        ObjectName on = ObjectName.getInstance(name);
+        assertTrue(mbeanServer.isRegistered(on));
+
+        Boolean started = (Boolean) mbeanServer.getAttribute(on, "Started");
+        assertEquals(true, started);
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("quartz2://myGroup/myTimerName?trigger.repeatInterval=2&trigger.repeatCount=1").routeId("myRoute").to("mock:result");
+            }
+        };
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzPropertiesTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzPropertiesTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzPropertiesTest.java
index 3a31efa..d7bfa1c 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzPropertiesTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzPropertiesTest.java
@@ -19,12 +19,11 @@ package org.apache.camel.component.quartz2;
 import java.io.InputStream;
 import java.util.Properties;
 
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.quartz.SchedulerException;
 
 
-public class QuartzPropertiesTest extends CamelTestSupport {
+public class QuartzPropertiesTest extends BaseQuartzTest {
 
     private QuartzComponent quartz;
 

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRepeatIntervalTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRepeatIntervalTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRepeatIntervalTest.java
index c1c6d78..6c42a7d 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRepeatIntervalTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRepeatIntervalTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzRepeatIntervalTest extends CamelTestSupport {
+public class QuartzRepeatIntervalTest extends BaseQuartzTest {
     protected MockEndpoint resultEndpoint;
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteFireNowTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteFireNowTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteFireNowTest.java
index b7e4273..c45b3c4 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteFireNowTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteFireNowTest.java
@@ -21,7 +21,7 @@ import org.apache.camel.builder.RouteBuilder;
 /**
  * @version 
  */
-public class QuartzRouteFireNowTest extends QuartzRouteTest {
+public class QuartzRouteFireNowTest extends BaseQuartzTest {
     
     @Override
     protected RouteBuilder createRouteBuilder() {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteRestartTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteRestartTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteRestartTest.java
index 8931c9f..24e4d08 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteRestartTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteRestartTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzRouteRestartTest extends CamelTestSupport {
+public class QuartzRouteRestartTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzCronRoute() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteTest.java
index 573521a..fc241c8 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzRouteTest extends CamelTestSupport {
+public class QuartzRouteTest extends BaseQuartzTest {
     protected MockEndpoint resultEndpoint;
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSimpleRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSimpleRouteTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSimpleRouteTest.java
index abaa87a..adb1113 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSimpleRouteTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSimpleRouteTest.java
@@ -18,7 +18,6 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.hamcrest.CoreMatchers;
 import org.junit.Assert;
 import org.junit.Test;
@@ -30,7 +29,7 @@ import org.quartz.Trigger;
  * This not only set SimpleTrigger as a timer endpoint in a route, and also test the trigger.XXX properties setter.
  * @version 
  */
-public class QuartzSimpleRouteTest extends CamelTestSupport {
+public class QuartzSimpleRouteTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzCronRoute() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedOptionTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedOptionTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedOptionTest.java
index a97c0f0..c85971e 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedOptionTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedOptionTest.java
@@ -18,10 +18,9 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
-public class QuartzStartDelayedOptionTest extends CamelTestSupport {
+public class QuartzStartDelayedOptionTest extends BaseQuartzTest {
 
     @Test
     public void testStartDelayed() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedTest.java
index 80d5d5d..1a036e6 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedTest.java
@@ -18,10 +18,9 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
-public class QuartzStartDelayedTest extends CamelTestSupport {
+public class QuartzStartDelayedTest extends BaseQuartzTest {
 
     @Test
     public void testStartDelayed() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStatefulJobRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStatefulJobRouteTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStatefulJobRouteTest.java
index d517659..8bedbcf 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStatefulJobRouteTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStatefulJobRouteTest.java
@@ -18,7 +18,6 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.hamcrest.CoreMatchers;
 import org.junit.Assert;
 import org.junit.Test;
@@ -28,9 +27,8 @@ import org.quartz.Trigger;
 
 /**
  * This test the  CronTrigger as a timer endpoint in a route.
- * @version 
  */
-public class QuartzStatefulJobRouteTest extends CamelTestSupport {
+public class QuartzStatefulJobRouteTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzCronRoute() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStopRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStopRouteTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStopRouteTest.java
index accb3d4..62afe1e 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStopRouteTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStopRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version
  */
-public class QuartzStopRouteTest extends CamelTestSupport {
+public class QuartzStopRouteTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzSuspend() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSuspendRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSuspendRouteTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSuspendRouteTest.java
index 8ce58bd..ebc4a16 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSuspendRouteTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSuspendRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version
  */
-public class QuartzSuspendRouteTest extends CamelTestSupport {
+public class QuartzSuspendRouteTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzSuspend() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/StatefulQuartzRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/StatefulQuartzRouteTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/StatefulQuartzRouteTest.java
index a690667..403273f 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/StatefulQuartzRouteTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/StatefulQuartzRouteTest.java
@@ -22,11 +22,10 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 
-public class StatefulQuartzRouteTest extends CamelTestSupport {
+public class StatefulQuartzRouteTest extends BaseQuartzTest {
     protected MockEndpoint resultEndpoint;
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/DateFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/DateFactory.java b/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/DateFactory.java
new file mode 100644
index 0000000..dabad29
--- /dev/null
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/DateFactory.java
@@ -0,0 +1,30 @@
+/**
+ * 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.routepolicy.quartz2;
+
+import java.util.Date;
+
+public final class DateFactory {
+
+    private DateFactory() {
+    }
+
+    public static Date createDate(int future) {
+        return new Date(System.currentTimeMillis() + future);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/SimpleDate.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/SimpleDate.java b/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/SimpleDate.java
deleted file mode 100644
index 3a50de7..0000000
--- a/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/SimpleDate.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.routepolicy.quartz2;
-
-import java.util.Date;
-
-public class SimpleDate extends Date {
-
-    private static final long serialVersionUID = 1L;
-
-    public SimpleDate() {
-        this(3000);
-    }
-
-    public SimpleDate(long milliseconds) {
-        super(System.currentTimeMillis() + milliseconds);
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/CronPolicies.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/CronPolicies.xml b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/CronPolicies.xml
index 63a8ea7..7e403ad 100644
--- a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/CronPolicies.xml
+++ b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/CronPolicies.xml
@@ -22,31 +22,29 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <bean id="date" class="org.apache.camel.routepolicy.quartz2.SimpleDate"/>
-
-    <bean id="defaultPolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy"/>
-
-    <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy">
-    	<property name="routeStartTime" value="*/3 * * * * ?"/>
-    </bean>
-    
-    <bean id="stopPolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy">
-    	<property name="routeStopTime" value="*/3 * * * * ?"/>
-	</bean>
-	
-	<bean id="suspendPolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy">
-    	<property name="routeSuspendTime" value="*/3 * * * * ?"/>
-  	</bean>
-  	
-  	<bean id="resumePolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy">
-    	<property name="routeResumeTime" value="*/3 * * * * ?"/>
- 	</bean> 
- 	
-    <routeContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
-        <route id="testRoute">
-            <from uri="direct:start"/>
-            <to uri="mock:success"/>
-        </route>
-    </routeContext>
+  <bean id="defaultPolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy"/>
+
+  <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy">
+    <property name="routeStartTime" value="*/3 * * * * ?"/>
+  </bean>
+
+  <bean id="stopPolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy">
+    <property name="routeStopTime" value="*/3 * * * * ?"/>
+  </bean>
+
+  <bean id="suspendPolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy">
+    <property name="routeSuspendTime" value="*/3 * * * * ?"/>
+  </bean>
+
+  <bean id="resumePolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy">
+    <property name="routeResumeTime" value="*/3 * * * * ?"/>
+  </bean>
+
+  <routeContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
+    <route id="testRoute">
+      <from uri="direct:start"/>
+      <to uri="mock:success"/>
+    </route>
+  </routeContext>
 
 </beans>

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/MultiplePolicies.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/MultiplePolicies.xml b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/MultiplePolicies.xml
index c2b5aee..4018d41 100644
--- a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/MultiplePolicies.xml
+++ b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/MultiplePolicies.xml
@@ -22,23 +22,25 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <bean id="date" class="org.apache.camel.routepolicy.quartz2.SimpleDate"/>
+  <bean id="now" class="org.apache.camel.routepolicy.quartz2.DateFactory" factory-method="createDate">
+    <constructor-arg index="0" value="3000"/>
+  </bean>
 
-    <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicy">
-    	<property name="routeStartDate" ref="date"/>
-    	<property name="routeStartRepeatCount" value="1"/>
-    	<property name="routeStartRepeatInterval" value="3000"/>    	
-    </bean>
-    
-    <bean id="throttlePolicy" class="org.apache.camel.impl.ThrottlingInflightRoutePolicy">
-    	<property name="maxInflightExchanges" value="10"/>    	
-	</bean>
-	 	
-    <camelContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
-        <route id="testRoute" autoStartup="false" routePolicyRef="startPolicy, throttlePolicy">
-            <from uri="seda:foo?concurrentConsumers=20"/>
-            <to uri="mock:success"/>
-        </route>
-    </camelContext>
+  <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicy">
+    <property name="routeStartDate" ref="now"/>
+    <property name="routeStartRepeatCount" value="1"/>
+    <property name="routeStartRepeatInterval" value="3000"/>
+  </bean>
+
+  <bean id="throttlePolicy" class="org.apache.camel.impl.ThrottlingInflightRoutePolicy">
+    <property name="maxInflightExchanges" value="10"/>
+  </bean>
+
+  <camelContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
+    <route id="testRoute" autoStartup="false" routePolicyRef="startPolicy, throttlePolicy">
+      <from uri="seda:foo?concurrentConsumers=20"/>
+      <to uri="mock:success"/>
+    </route>
+  </camelContext>
 
 </beans>


Mime
View raw message