camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bvah...@apache.org
Subject git commit: CAMEL-6365: Better reuse the IOHelper utility to close the Spring contexts.
Date Fri, 07 Feb 2014 08:46:39 GMT
Updated Branches:
  refs/heads/master d6a7b27d6 -> 714e2b460


CAMEL-6365: Better reuse the IOHelper utility to close the Spring contexts.

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

Branch: refs/heads/master
Commit: 714e2b4600827277097fdcf2ff8cc1e7ca46c8ce
Parents: d6a7b27
Author: Babak Vahdat <bvahdat@apache.org>
Authored: Fri Feb 7 09:46:10 2014 +0100
Committer: Babak Vahdat <bvahdat@apache.org>
Committed: Fri Feb 7 09:46:10 2014 +0100

----------------------------------------------------------------------
 .../SpringQuartzConsumerTwoAppsClusteredFailoverTest.java | 10 ++++------
 .../quartz/SpringQuartzPersistentStoreRestartAppTest.java |  4 ++--
 .../quartz/SpringQuartzTwoAppsClusteredFailoverTest.java  | 10 ++++------
 .../SpringQuartzConsumerTwoAppsClusteredFailoverTest.java | 10 ++++------
 .../SpringQuartzPersistentStoreRestartAppTest.java        |  4 ++--
 .../quartz2/SpringQuartzTwoAppsClusteredFailoverTest.java | 10 ++++------
 6 files changed, 20 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/714e2b46/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzConsumerTwoAppsClusteredFailoverTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzConsumerTwoAppsClusteredFailoverTest.java
b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzConsumerTwoAppsClusteredFailoverTest.java
index 0fa3924..146732e 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzConsumerTwoAppsClusteredFailoverTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzConsumerTwoAppsClusteredFailoverTest.java
@@ -21,6 +21,7 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Predicate;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.TestSupport;
+import org.apache.camel.util.IOHelper;
 import org.junit.Test;
 import org.springframework.context.support.AbstractXmlApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -59,7 +60,7 @@ public class SpringQuartzConsumerTwoAppsClusteredFailoverTest extends TestSuppor
 
         // now let's simulate a crash of the first app (the quartz instance 'app-one')
         log.warn("The first app is going to crash NOW!");
-        app.close();
+        IOHelper.close(app);
 
         log.warn("Crashed...");
         log.warn("Crashed...");
@@ -83,11 +84,8 @@ public class SpringQuartzConsumerTwoAppsClusteredFailoverTest extends TestSuppor
 
         mock2.assertIsSatisfied();
 
-        // close the second app as we're done now
-        app2.close();
-
-        // and as the last step shutdown the database...
-        db.close();
+        // and as the last step shutdown the second app as well as the database
+        IOHelper.close(app2, db);
     }
     
     private static class ClusteringPredicate implements Predicate {

http://git-wip-us.apache.org/repos/asf/camel/blob/714e2b46/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartAppTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartAppTest.java
b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartAppTest.java
index dc008d6..f7ce53c 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartAppTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartAppTest.java
@@ -19,6 +19,7 @@ package org.apache.camel.component.quartz;
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.TestSupport;
+import org.apache.camel.util.IOHelper;
 import org.junit.Test;
 import org.springframework.context.support.AbstractXmlApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -74,8 +75,7 @@ public class SpringQuartzPersistentStoreRestartAppTest extends TestSupport
{
         // we're done so let's properly close the application contexts, but close
         // the second app before the first one so that the quartz scheduler running
         // inside it can be properly shutdown
-        app2.close();
-        app.close();
+        IOHelper.close(app2, app);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/714e2b46/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringQuartzTwoAppsClusteredFailoverTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringQuartzTwoAppsClusteredFailoverTest.java
b/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringQuartzTwoAppsClusteredFailoverTest.java
index 967521e..b0df94f 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringQuartzTwoAppsClusteredFailoverTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringQuartzTwoAppsClusteredFailoverTest.java
@@ -20,6 +20,7 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.TestSupport;
+import org.apache.camel.util.IOHelper;
 import org.junit.Test;
 import org.springframework.context.support.AbstractXmlApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -60,7 +61,7 @@ public class SpringQuartzTwoAppsClusteredFailoverTest extends TestSupport
{
 
         // now let's simulate a crash of the first app (the quartz instance 'app-one')
         log.warn("The first app is going to crash NOW!");
-        app.close();
+        IOHelper.close(app);
 
         log.warn("Crashed...");
         log.warn("Crashed...");
@@ -86,11 +87,8 @@ public class SpringQuartzTwoAppsClusteredFailoverTest extends TestSupport
{
 
         mock2.assertIsSatisfied();
 
-        // close the second app as we're done now
-        app2.close();
-
-        // and as the last step shutdown the database...
-        db.close();
+        // and as the last step shutdown the second app as well as the database
+        IOHelper.close(app2, db);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/714e2b46/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/SpringQuartzConsumerTwoAppsClusteredFailoverTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/SpringQuartzConsumerTwoAppsClusteredFailoverTest.java
b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/SpringQuartzConsumerTwoAppsClusteredFailoverTest.java
index fcec7ab..a8de1bd 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/SpringQuartzConsumerTwoAppsClusteredFailoverTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/SpringQuartzConsumerTwoAppsClusteredFailoverTest.java
@@ -21,6 +21,7 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Predicate;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.TestSupport;
+import org.apache.camel.util.IOHelper;
 import org.junit.Test;
 import org.springframework.context.support.AbstractXmlApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -59,7 +60,7 @@ public class SpringQuartzConsumerTwoAppsClusteredFailoverTest extends TestSuppor
 
         // now let's simulate a crash of the first app (the quartz instance 'app-one')
         log.warn("The first app is going to crash NOW!");
-        app.close();
+        IOHelper.close(app);
 
         log.warn("Crashed...");
         log.warn("Crashed...");
@@ -83,11 +84,8 @@ public class SpringQuartzConsumerTwoAppsClusteredFailoverTest extends TestSuppor
 
         mock2.assertIsSatisfied();
 
-        // close the second app as we're done now
-        app2.close();
-
-        // and as the last step shutdown the database...
-        db.close();
+        // and as the last step shutdown the second app as well as the database
+        IOHelper.close(app2, db);
     }
     
     private static class ClusteringPredicate implements Predicate {

http://git-wip-us.apache.org/repos/asf/camel/blob/714e2b46/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartAppTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartAppTest.java
b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartAppTest.java
index bad18cb..f083a1c 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartAppTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartAppTest.java
@@ -19,6 +19,7 @@ package org.apache.camel.component.quartz2;
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.TestSupport;
+import org.apache.camel.util.IOHelper;
 import org.junit.Test;
 import org.springframework.context.support.AbstractXmlApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -74,8 +75,7 @@ public class SpringQuartzPersistentStoreRestartAppTest extends TestSupport
{
         // we're done so let's properly close the application contexts, but close
         // the second app before the first one so that the quartz scheduler running
         // inside it can be properly shutdown
-        app2.close();
-        app.close();
+        IOHelper.close(app2, app);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/714e2b46/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/SpringQuartzTwoAppsClusteredFailoverTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/SpringQuartzTwoAppsClusteredFailoverTest.java
b/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/SpringQuartzTwoAppsClusteredFailoverTest.java
index a687cbe..30cce7f 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/SpringQuartzTwoAppsClusteredFailoverTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/SpringQuartzTwoAppsClusteredFailoverTest.java
@@ -20,6 +20,7 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.TestSupport;
+import org.apache.camel.util.IOHelper;
 import org.junit.Test;
 import org.springframework.context.support.AbstractXmlApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -60,7 +61,7 @@ public class SpringQuartzTwoAppsClusteredFailoverTest extends TestSupport
{
 
         // now let's simulate a crash of the first app (the quartz instance 'app-one')
         log.warn("The first app is going to crash NOW!");
-        app.close();
+        IOHelper.close(app);
 
         log.warn("Crashed...");
         log.warn("Crashed...");
@@ -86,11 +87,8 @@ public class SpringQuartzTwoAppsClusteredFailoverTest extends TestSupport
{
 
         mock2.assertIsSatisfied();
 
-        // close the second app as we're done now
-        app2.close();
-
-        // and as the last step shutdown the database...
-        db.close();
+        // and as the last step shutdown the second app as well as the database
+        IOHelper.close(app2, db);
     }
 
 }


Mime
View raw message