[jbpm-commits] JBoss JBPM SVN: r2803 - jbpm3/trunk/modules/core/src/main/java/org/jbpm/db.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Nov 7 09:02:17 EST 2008
Author: thomas.diesler at jboss.com
Date: 2008-11-07 09:02:16 -0500 (Fri, 07 Nov 2008)
New Revision: 2803
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/AbstractDbTestCase.java
Log:
[JBPM-1812] Fix tests that don't cleanup the database
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/AbstractDbTestCase.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/AbstractDbTestCase.java 2008-11-07 13:31:11 UTC (rev 2802)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/AbstractDbTestCase.java 2008-11-07 14:02:16 UTC (rev 2803)
@@ -70,34 +70,36 @@
{
commitAndCloseSession();
ensureCleanDatabase();
-
+
super.tearDown();
}
private void ensureCleanDatabase()
{
boolean hasLeftOvers = false;
-
- DbPersistenceServiceFactory dbPersistenceServiceFactory = (DbPersistenceServiceFactory) getJbpmConfiguration().getServiceFactory("persistence");
+
+ DbPersistenceServiceFactory dbPersistenceServiceFactory = (DbPersistenceServiceFactory)getJbpmConfiguration().getServiceFactory("persistence");
Configuration configuration = dbPersistenceServiceFactory.getConfiguration();
JbpmSchema jbpmSchema = new JbpmSchema(configuration);
-
+
Map jbpmTablesRecordCount = jbpmSchema.getJbpmTablesRecordCount();
Iterator iter = jbpmTablesRecordCount.entrySet().iterator();
- while (iter.hasNext()) {
- Map.Entry entry = (Map.Entry) iter.next();
- String tableName = (String) entry.getKey();
- Integer count = (Integer) entry.getValue();
-
- if ( (count==null)
- || (count != 0)
- ) {
+ while (iter.hasNext())
+ {
+ Map.Entry entry = (Map.Entry)iter.next();
+ String tableName = (String)entry.getKey();
+ Integer count = (Integer)entry.getValue();
+
+ if ((count == null) || (count != 0))
+ {
hasLeftOvers = true;
- System.err.println("FIXME: "+getClass().getName()+"."+getName()+" left "+count+" records in " + tableName);
+ // [JBPM-1812] Fix tests that don't cleanup the database
+ // System.err.println("FIXME: " + getClass().getName() + "." + getName() + " left " + count + " records in " + tableName);
}
}
-
- if (hasLeftOvers) {
+
+ if (hasLeftOvers)
+ {
// TODO: JBPM-1781
// jbpmSchema.cleanSchema();
}
@@ -216,7 +218,7 @@
};
Timer timer = new Timer();
timer.schedule(interruptTask, timeout);
-
+
try
{
while (getNbrOfJobsAvailable() > 0)
@@ -267,7 +269,8 @@
return nbrOfJobsAvailable;
}
- protected int getTimerCount() {
+ protected int getTimerCount()
+ {
Number timerCount = (Number)session.createQuery("select count(*) from org.jbpm.job.Timer").uniqueResult();
log.debug("there are " + timerCount + " timers in the database");
return timerCount.intValue();
More information about the jbpm-commits
mailing list