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 2010/09/16 19:32:16 UTC
svn commit: r997858 - in
/camel/trunk/components/camel-test/src/main/java/org/apache/camel/test:
CamelTestSupport.java junit4/CamelTestSupport.java
Author: davsclaus
Date: Thu Sep 16 17:32:16 2010
New Revision: 997858
URL: http://svn.apache.org/viewvc?rev=997858&view=rev
Log:
CAMEL-3129: Made it easier to override shutdown timeout with camel test kit.
Modified:
camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java
camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java
Modified: camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java?rev=997858&r1=997857&r2=997858&view=diff
==============================================================================
--- camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java (original)
+++ camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java Thu Sep 16 17:32:16 2010
@@ -95,7 +95,7 @@ public abstract class CamelTestSupport e
assertValidContext(context);
// reduce default shutdown timeout to avoid waiting for 300 seconds
- context.getShutdownStrategy().setTimeout(10);
+ context.getShutdownStrategy().setTimeout(getShutdownTimeout());
template = context.createProducerTemplate();
template.start();
@@ -131,6 +131,17 @@ public abstract class CamelTestSupport e
}
/**
+ * Returns the timeout to use when shutting down (unit in seconds).
+ * <p/>
+ * Will default use 10 seconds.
+ *
+ * @return the timeout to use
+ */
+ protected int getShutdownTimeout() {
+ return 10;
+ }
+
+ /**
* Whether or not JMX should be used during testing.
*
* @return <tt>false</tt> by default.
Modified: camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java?rev=997858&r1=997857&r2=997858&view=diff
==============================================================================
--- camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java (original)
+++ camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java Thu Sep 16 17:32:16 2010
@@ -97,7 +97,7 @@ public abstract class CamelTestSupport e
assertValidContext(context);
// reduce default shutdown timeout to avoid waiting for 300 seconds
- context.getShutdownStrategy().setTimeout(10);
+ context.getShutdownStrategy().setTimeout(getShutdownTimeout());
template = context.createProducerTemplate();
template.start();
@@ -135,6 +135,17 @@ public abstract class CamelTestSupport e
}
/**
+ * Returns the timeout to use when shutting down (unit in seconds).
+ * <p/>
+ * Will default use 10 seconds.
+ *
+ * @return the timeout to use
+ */
+ protected int getShutdownTimeout() {
+ return 10;
+ }
+
+ /**
* Whether or not JMX should be used during testing.
*
* @return <tt>false</tt> by default.