camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [2/4] camel git commit: CAMEL-7627 Fix the unit test error of SpringQuartzPersistentStoreRestartAppChangeOptionsTest
Date Fri, 14 Nov 2014 02:47:51 GMT
CAMEL-7627 Fix the unit test error of SpringQuartzPersistentStoreRestartAppChangeOptionsTest


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

Branch: refs/heads/camel-2.14.x
Commit: f527e0376c96c8e2afd712b8f38982fa88b19c9e
Parents: 29350e3
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Fri Nov 14 10:44:19 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Fri Nov 14 10:46:59 2014 +0800

----------------------------------------------------------------------
 ...sistentStoreRestartAppChangeOptionsTest.java | 21 ++++++++++++++------
 ...sistentStoreRestartAppChangeOptionsTest.java | 16 ++++++++++-----
 2 files changed, 26 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f527e037/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartAppChangeOptionsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartAppChangeOptionsTest.java
b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartAppChangeOptionsTest.java
index 8ec91fd..e930c47 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartAppChangeOptionsTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartAppChangeOptionsTest.java
@@ -20,7 +20,8 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.test.junit4.TestSupport;
 import org.apache.camel.util.IOHelper;
 import org.junit.After;
-import org.junit.Before;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.quartz.CronTrigger;
 import org.quartz.Scheduler;
@@ -32,23 +33,29 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class SpringQuartzPersistentStoreRestartAppChangeOptionsTest extends TestSupport {
 
-    private AbstractXmlApplicationContext db;
+    private static AbstractXmlApplicationContext db;
     private AbstractXmlApplicationContext app;
     private AbstractXmlApplicationContext app2;
 
-    @Before
-    public void prepareDB() {
+    @BeforeClass
+    public static void prepareDB() {
         // boot up the database the two invocations are going to share inside a clustered
quartz setup
         db = new ClassPathXmlApplicationContext("org/apache/camel/component/quartz/SpringQuartzConsumerClusteredAppDatabase.xml");
         db.start();
     }
+    
+    @AfterClass
+    public static void shutdownDB() {
+        db.close();
+    }
 
     @After
     public void closeApps() {
         // 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
-        IOHelper.close(app2, app, db);
+        IOHelper.close(app2, app);
+        
     }
 
 
@@ -78,8 +85,10 @@ public class SpringQuartzPersistentStoreRestartAppChangeOptionsTest extends
Test
         assertNotNull(camel2);
         String cronExpression2 = ((CronTrigger) getTrigger(camel2, "quartzRoute")).getCronExpression();
         app2.stop();
-
+        
         assertNotEquals(cronExpression, cronExpression2);
+        
+        
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/f527e037/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartAppChangeOptionsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartAppChangeOptionsTest.java
b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartAppChangeOptionsTest.java
index 125c8bc..fdebbe2 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartAppChangeOptionsTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartAppChangeOptionsTest.java
@@ -20,7 +20,8 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.test.junit4.TestSupport;
 import org.apache.camel.util.IOHelper;
 import org.junit.After;
-import org.junit.Before;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.quartz.CronTrigger;
 import org.quartz.Scheduler;
@@ -34,23 +35,28 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
  */
 public class SpringQuartzPersistentStoreRestartAppChangeOptionsTest extends TestSupport {
 
-    private AbstractXmlApplicationContext db;
+    private static AbstractXmlApplicationContext db;
     private AbstractXmlApplicationContext app;
     private AbstractXmlApplicationContext app2;
 
-    @Before
-    public void prepareDB() {
+    @BeforeClass
+    public static void prepareDB() {
         // boot up the database the two invocations are going to share inside a clustered
quartz setup
         db = new ClassPathXmlApplicationContext("org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppDatabase.xml");
         db.start();
     }
+    
+    @AfterClass
+    public static void shutdownDB() {
+        db.close();
+    }
 
     @After
     public void closeApps() {
         // 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
-        IOHelper.close(app2, app, db);
+        IOHelper.close(app2, app);
     }
 
 


Mime
View raw message