[jbpm-commits] JBoss JBPM SVN: r3656 - in jbpm3/trunk/modules: core/src/test/java/org/jbpm/jbpm1778 and 3 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Jan 15 12:44:43 EST 2009


Author: thomas.diesler at jboss.com
Date: 2009-01-15 12:44:42 -0500 (Thu, 15 Jan 2009)
New Revision: 3656

Added:
   jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1798/
   jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1798/JBPM1798Test.java
Removed:
   jbpm3/trunk/modules/userguide/src/main/docbook/de/
Modified:
   jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1778/JBPM1778Test.java
   jbpm3/trunk/modules/core/src/test/java/org/jbpm/job/executor/JobExecutorDbTest.java
Log:
remove unsupported german userguide

Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1778/JBPM1778Test.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1778/JBPM1778Test.java	2009-01-15 17:24:16 UTC (rev 3655)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1778/JBPM1778Test.java	2009-01-15 17:44:42 UTC (rev 3656)
@@ -19,7 +19,7 @@
 {
   public void testEmptyMapVariables()
   {
-    ProcessDefinition pd = getProcessDEfinition();
+    ProcessDefinition pd = getProcessDefinition();
     
     ProcessInstance pi = pd.createProcessInstance(new HashMap<String, String>());
     TaskMgmtInstance tmi = pi.getTaskMgmtInstance();
@@ -32,7 +32,7 @@
 
   public void testNonEmptyMapVariables()
   {
-    ProcessDefinition pd = getProcessDEfinition();
+    ProcessDefinition pd = getProcessDefinition();
     
     HashMap<String, String> vars = new HashMap<String, String>();
     vars.put("uno", "dos");
@@ -46,7 +46,7 @@
     assertEquals("ProcessInstance vars not empty", 1, piVars.size());
   }
 
-  private ProcessDefinition getProcessDEfinition()
+  private ProcessDefinition getProcessDefinition()
   {
     ProcessDefinition pd = ProcessDefinition.parseXmlString(
         "<process-definition>" + 

Added: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1798/JBPM1798Test.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1798/JBPM1798Test.java	                        (rev 0)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1798/JBPM1798Test.java	2009-01-15 17:44:42 UTC (rev 3656)
@@ -0,0 +1,53 @@
+package org.jbpm.jbpm1798;
+
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * Potential nullpointer in asynchronous jobs when process ends
+ * 
+ * https://jira.jboss.org/jira/browse/JBPM-1798
+ * 
+ * @author Thomas.Diesler at jboss.com
+ */
+public class JBPM1798Test extends AbstractDbTestCase
+{
+  public void testJobExecution()
+  {
+    ProcessDefinition pd = getProcessDefinition();
+    jbpmContext.deployProcessDefinition(pd);
+    
+    pd.createProcessInstance();
+    
+    newTransaction();
+    
+    startJobExecutor();
+  }
+
+  private ProcessDefinition getProcessDefinition()
+  {
+    ProcessDefinition pd = ProcessDefinition.parseXmlString(
+        "<process-definition name='customjobexecution' initial='start'>" +
+        " <node name='start'>" +
+        " <transition to='end'>" +
+        " <action async='true' class='" + AsyncAction.class.getName() + "' />" +
+        " </transition>" +
+        " </node>" +
+        " <end-state name='end' />" +
+        "</process-definition>");
+    return pd;
+  }
+
+  public static class AsyncAction implements ActionHandler
+  {
+    private static final long serialVersionUID = 1L;
+
+    public void execute(ExecutionContext executionContext) throws Exception
+    {
+      System.out.println("do stuff");
+    }
+  }
+}


Property changes on: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1798/JBPM1798Test.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/job/executor/JobExecutorDbTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/job/executor/JobExecutorDbTest.java	2009-01-15 17:24:16 UTC (rev 3655)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/job/executor/JobExecutorDbTest.java	2009-01-15 17:44:42 UTC (rev 3656)
@@ -13,7 +13,8 @@
 import org.jbpm.graph.exe.ExecutionContext;
 import org.jbpm.graph.exe.ProcessInstance;
 
-public class JobExecutorDbTest extends AbstractDbTestCase {
+public class JobExecutorDbTest extends AbstractDbTestCase 
+{
 
   static final int nbrOfConcurrentProcessExecutions = 20;
   static final int timeout = 60000;
@@ -22,20 +23,23 @@
   static List<Long> allocatedProcessIds = Collections.synchronizedList(new ArrayList<Long>());
 
   @Override
-  protected void setUp() throws Exception {
+  protected void setUp() throws Exception
+  {
     super.setUp();
-    deployProcess();    
+    deployProcess();
     getJbpmConfiguration().getJobExecutor().setNbrOfThreads(5);
   }
 
   @Override
-  protected void tearDown() throws Exception {
+  protected void tearDown() throws Exception
+  {
     getJbpmConfiguration().getJobExecutor().setNbrOfThreads(1);
     deleteProcess();
     super.tearDown();
   }
 
-  public void testJobExecutor() {
+  public void testJobExecutor()
+  {
     launchProcesses();
     processJobs(timeout);
     assertEquals(createExpectedResults(), collectedResults);
@@ -96,17 +100,21 @@
     jbpmContext.deployProcessDefinition(processDefinition);
   }
 
-  void launchProcesses() {
-    for (int i = 0; i < nbrOfConcurrentProcessExecutions; i++) {
+  void launchProcesses()
+  {
+    for (int i = 0; i < nbrOfConcurrentProcessExecutions; i++)
+    {
       newTransaction();
       ProcessInstance processInstance = jbpmContext.newProcessInstanceForUpdate("bulk messages");
       processInstance.signal();
     }
   }
 
-  Set<String> createExpectedResults() {
+  Set<String> createExpectedResults()
+  {
     Set<String> expectedResults = new TreeSet<String>();
-    for (int i = 0; i < nbrOfConcurrentProcessExecutions; i++) {
+    for (int i = 0; i < nbrOfConcurrentProcessExecutions; i++)
+    {
       String prefix = (i < 10 ? "0" : "");
       expectedResults.add(prefix + i + "a");
       expectedResults.add(prefix + i + "b");
@@ -120,16 +128,19 @@
     return expectedResults;
   }
 
-  void deleteProcess() {
+  void deleteProcess()
+  {
     ProcessDefinition processDefinition = graphSession.findLatestProcessDefinition("bulk messages");
     graphSession.deleteProcessDefinition(processDefinition);
   }
 
-  public static class AutomaticActivity implements ActionHandler {
+  public static class AutomaticActivity implements ActionHandler
+  {
 
     private static final long serialVersionUID = 1L;
 
-    public void execute(ExecutionContext executionContext) throws Exception {
+    public void execute(ExecutionContext executionContext) throws Exception
+    {
       Long id = executionContext.getProcessInstance().getId();
       String procIndex = getProcessIndex(id);
 
@@ -139,11 +150,13 @@
     }
   }
 
-  public static class AsyncAction implements ActionHandler {
+  public static class AsyncAction implements ActionHandler
+  {
 
     private static final long serialVersionUID = 1L;
 
-    public void execute(ExecutionContext executionContext) throws Exception {
+    public void execute(ExecutionContext executionContext) throws Exception
+    {
       Long id = executionContext.getProcessInstance().getId();
       String procIndex = getProcessIndex(id);
 
@@ -153,7 +166,8 @@
     }
   }
 
-  static synchronized String getProcessIndex(Long id) {
+  static synchronized String getProcessIndex(Long id)
+  {
     if (allocatedProcessIds.contains(id) == false)
       allocatedProcessIds.add(id);
 




More information about the jbpm-commits mailing list