[jbpm-commits] JBoss JBPM SVN: r2446 - in jbpm3/trunk/modules/core/src: test/java/org/jbpm/graph/exe and 1 other directory.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Sep 30 04:31:42 EDT 2008
Author: tom.baeyens at jboss.com
Date: 2008-09-30 04:31:42 -0400 (Tue, 30 Sep 2008)
New Revision: 2446
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/AbstractJbpmTestCase.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/graph/exe/ProcessInstanceDbTest.java
Log:
cleanup ProcessInstanceDbTest: JBPM-1734
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/AbstractJbpmTestCase.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/AbstractJbpmTestCase.java 2008-09-30 08:24:31 UTC (rev 2445)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/AbstractJbpmTestCase.java 2008-09-30 08:31:42 UTC (rev 2446)
@@ -21,6 +21,7 @@
*/
package org.jbpm;
+import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
import org.apache.commons.logging.Log;
@@ -50,4 +51,18 @@
{
return getClass().getName() + "." + getName();
}
+
+ protected void runTest() throws Throwable {
+ try {
+ super.runTest();
+ } catch (AssertionFailedError e) {
+ log.error("");
+ log.error("ASSERTION FAILURE: "+e.getMessage());
+ log.error("");
+ throw e;
+ } catch (Throwable t) {
+ t.printStackTrace();
+ throw t;
+ }
+ }
}
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/graph/exe/ProcessInstanceDbTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/graph/exe/ProcessInstanceDbTest.java 2008-09-30 08:24:31 UTC (rev 2445)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/graph/exe/ProcessInstanceDbTest.java 2008-09-30 08:31:42 UTC (rev 2446)
@@ -91,23 +91,19 @@
public void testProcessInstanceSuperProcessToken()
{
- if (true)
- {
- System.out.println("FIXME [JBPM-1734]: Cleanup ProcessInstanceDbTest");
- return;
- }
+ ProcessDefinition superProcessDefinition = new ProcessDefinition("super");
+ jbpmContext.deployProcessDefinition(superProcessDefinition);
- ProcessDefinition processDefinition = new ProcessDefinition("super");
- jbpmContext.deployProcessDefinition(processDefinition);
+ ProcessDefinition subProcessDefinition = new ProcessDefinition("sub");
+ jbpmContext.deployProcessDefinition(subProcessDefinition);
+
+ ProcessInstance superProcessInstance = new ProcessInstance(superProcessDefinition);
+ ProcessInstance processInstance = new ProcessInstance(subProcessDefinition);
try
{
-
- ProcessInstance superProcessInstance = new ProcessInstance(processDefinition);
Token superProcessToken = superProcessInstance.getRootToken();
- jbpmContext.deployProcessDefinition(processDefinition);
jbpmContext.save(superProcessInstance);
- ProcessInstance processInstance = new ProcessInstance();
processInstance.setSuperProcessToken(superProcessToken);
processInstance = saveAndReload(processInstance);
@@ -116,24 +112,23 @@
assertNotNull(superProcessToken);
superProcessInstance = superProcessToken.getProcessInstance();
assertNotNull(superProcessInstance);
- ProcessDefinition processDefinitionTwo = superProcessInstance.getProcessDefinition();
- assertEquals("super", processDefinitionTwo.getName());
+
+ ProcessDefinition processDefinition = superProcessInstance.getProcessDefinition();
+ assertEquals("super", processDefinition.getName());
}
finally
{
- jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
+ jbpmContext.getGraphSession().deleteProcessDefinition(subProcessDefinition.getId());
+ jbpmContext.getGraphSession().deleteProcessDefinition(superProcessDefinition.getId());
}
}
public void testProcessInstanceModuleInstances()
{
- if (true)
- {
- System.out.println("FIXME [JBPM-1734]: Cleanup ProcessInstanceDbTest");
- return;
- }
+ ProcessDefinition processDefinition = new ProcessDefinition("modinst");
+ jbpmContext.deployProcessDefinition(processDefinition);
- ProcessInstance processInstance = new ProcessInstance();
+ ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.addInstance(new ContextInstance());
processInstance.addInstance(new TaskMgmtInstance());
@@ -147,19 +142,16 @@
}
finally
{
- jbpmContext.getGraphSession().deleteProcessInstance(processInstance.getId());
+ jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
}
}
public void testProcessInstanceRuntimeActions()
{
- if (true)
- {
- System.out.println("FIXME [JBPM-1734]: Cleanup ProcessInstanceDbTest");
- return;
- }
-
- ProcessInstance processInstance = new ProcessInstance();
+ ProcessDefinition processDefinition = new ProcessDefinition("modinst");
+ jbpmContext.deployProcessDefinition(processDefinition);
+
+ ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.addRuntimeAction(new RuntimeAction());
processInstance.addRuntimeAction(new RuntimeAction());
processInstance.addRuntimeAction(new RuntimeAction());
@@ -173,7 +165,7 @@
}
finally
{
- jbpmContext.getGraphSession().deleteProcessInstance(processInstance.getId());
+ jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
}
}
}
More information about the jbpm-commits
mailing list