[jbpm-commits] JBoss JBPM SVN: r6142 - jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/persistence/db.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Jan 28 03:51:57 EST 2010


Author: alex.guizar at jboss.com
Date: 2010-01-28 03:51:56 -0500 (Thu, 28 Jan 2010)
New Revision: 6142

Modified:
   jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/persistence/db/PersistenceServiceDbTest.java
Log:
JBPM-2047: make PersistenceServiceDbTest use a pristine, unshared JbpmConfiguration instance to prevent other tests from affecting it

Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/persistence/db/PersistenceServiceDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/persistence/db/PersistenceServiceDbTest.java	2010-01-27 15:37:12 UTC (rev 6141)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/persistence/db/PersistenceServiceDbTest.java	2010-01-28 08:51:56 UTC (rev 6142)
@@ -39,8 +39,20 @@
 
 public class PersistenceServiceDbTest extends AbstractJbpmTestCase {
   
+  private JbpmConfiguration jbpmConfiguration;
+  
+  protected void setUp() throws Exception {
+    super.setUp();
+    // pristine, unshared configuration object
+    jbpmConfiguration = JbpmConfiguration.parseInputStream(null);
+  }
+
+  protected void tearDown() throws Exception {
+    jbpmConfiguration.close();
+    super.tearDown();
+  }
+
   public void testDefaults() throws Exception {
-    JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
     JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
     
     DbPersistenceServiceFactory persistenceServiceFactory = null;
@@ -109,7 +121,6 @@
   }
 
   public void testRollbackWithoutSessionCreation() throws Exception {
-    JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
     JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
     
     DbPersistenceService persistenceService = null;
@@ -125,7 +136,6 @@
   }
 
   public void testRollback() throws Exception {
-    JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
     JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
     
     DbPersistenceService persistenceService = null;
@@ -145,7 +155,6 @@
   }
   
   public void testUserSuppliedConnection() throws Exception {
-    JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
     JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
     
     DbPersistenceService persistenceService = null;
@@ -176,7 +185,6 @@
   }
   
   public void testUserSuppliedConnectionWithRollback() throws Exception {
-    JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
     JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
     
     DbPersistenceService persistenceService = null;
@@ -209,7 +217,6 @@
   }
   
   public void testUserSuppliedSession() throws Exception {
-    JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
     JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
     
     DbPersistenceService persistenceService = null;
@@ -236,7 +243,6 @@
   }
 
   public void testUserSuppliedSessionWithRollback() throws Exception {
-    JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
     JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
       
     try {
@@ -261,7 +267,6 @@
   }
 
   public void testTransferResponsibility() throws Exception {
-    JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
     JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
     
     DbPersistenceService dbPersistenceService = null; 



More information about the jbpm-commits mailing list