[jbpm-commits] JBoss JBPM SVN: r2154 - jbpm3/trunk/modules/core/src/test/java/org/jbpm/job/executor.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Sep 9 10:49:38 EDT 2008
Author: thomas.diesler at jboss.com
Date: 2008-09-09 10:49:37 -0400 (Tue, 09 Sep 2008)
New Revision: 2154
Modified:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/job/executor/MultiJobExecutorDbTest.java
Log:
Comment System.out.println in core tests
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/job/executor/MultiJobExecutorDbTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/job/executor/MultiJobExecutorDbTest.java 2008-09-09 14:41:32 UTC (rev 2153)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/job/executor/MultiJobExecutorDbTest.java 2008-09-09 14:49:37 UTC (rev 2154)
@@ -49,36 +49,42 @@
+ "<end-state name='end-state1' />"
+ "</process-definition>";
- protected void setUp() throws SQLException {
+ protected void setUp() throws SQLException
+ {
jbpmConfiguration.createSchema();
// deploy process definition
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- try {
+ try
+ {
jbpmContext.deployProcessDefinition(ProcessDefinition.parseXmlString(PROCESS_DEFINITION));
}
- finally {
+ finally
+ {
jbpmContext.close();
}
}
- public void testMultipleJobExecutors() {
+ public void testMultipleJobExecutors()
+ {
// start job executors
- for (int i = 0; i < executors.length; i++) {
- executors[i] = (JobExecutor) JbpmConfiguration.Configs.getObjectFactory().createObject(
- "jbpm.job.executor");
+ for (int i = 0; i < executors.length; i++)
+ {
+ executors[i] = (JobExecutor)JbpmConfiguration.Configs.getObjectFactory().createObject("jbpm.job.executor");
executors[i].setName("JbpmJobExecutor/" + (i + 1));
executors[i].start();
}
// kick off process instance
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- try {
+ try
+ {
ProcessInstance processInstance = jbpmContext.newProcessInstanceForUpdate(PROCESS_NAME);
processInstance.getContextInstance().setVariable("eventCallback", new EventCallback());
processInstance.signal();
}
- finally {
+ finally
+ {
jbpmContext.close();
}
@@ -86,11 +92,14 @@
EventCallback.waitForEvent(Event.EVENTTYPE_PROCESS_END);
// stop job executors
- for (int i = executors.length - 1; i >= 0; i--) {
- try {
+ for (int i = executors.length - 1; i >= 0; i--)
+ {
+ try
+ {
executors[i].stopAndJoin();
}
- catch (InterruptedException e) {
+ catch (InterruptedException e)
+ {
// continue to next executor
}
}
@@ -98,37 +107,43 @@
assertEquals(1, SimpleAction2.getExecutionCount());
}
- protected void tearDown() {
+ protected void tearDown()
+ {
jbpmConfiguration.dropSchema();
}
- public static class SimpleAction implements ActionHandler {
+ public static class SimpleAction implements ActionHandler
+ {
private static final long serialVersionUID = 1L;
- public void execute(ExecutionContext exeContext) throws Exception {
- // System.out.println("Action 1");
+ public void execute(ExecutionContext exeContext) throws Exception
+ {
exeContext.leaveNode();
}
}
- public static class SimpleAction2 implements ActionHandler {
+ public static class SimpleAction2 implements ActionHandler
+ {
private static int executionCount = 0;
private static final long serialVersionUID = 1L;
- public void execute(ExecutionContext exeContext) throws Exception {
- // System.out.println("Action 2: " + incrementCount());
+ public void execute(ExecutionContext exeContext) throws Exception
+ {
+ incrementCount();
exeContext.leaveNode();
}
- private static synchronized int incrementCount() {
+ private static synchronized int incrementCount()
+ {
return ++executionCount;
}
- public static synchronized int getExecutionCount() {
+ public static synchronized int getExecutionCount()
+ {
return executionCount;
}
}
More information about the jbpm-commits
mailing list