[jbpm-commits] JBoss JBPM SVN: r2434 - in jbpm3/trunk/modules/examples: src/test/java/org/jbpm/examples/taskmgmt and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Sep 29 06:55:21 EDT 2008


Author: thomas.diesler at jboss.com
Date: 2008-09-29 06:55:21 -0400 (Mon, 29 Sep 2008)
New Revision: 2434

Modified:
   jbpm3/trunk/modules/examples/pom.xml
   jbpm3/trunk/modules/examples/src/test/java/org/jbpm/examples/taskmgmt/TaskAssignmentTest.java
Log:
[JBPM-1750] Fix examples/taskmgmt

Modified: jbpm3/trunk/modules/examples/pom.xml
===================================================================
--- jbpm3/trunk/modules/examples/pom.xml	2008-09-29 10:52:58 UTC (rev 2433)
+++ jbpm3/trunk/modules/examples/pom.xml	2008-09-29 10:55:21 UTC (rev 2434)
@@ -103,7 +103,6 @@
         <configuration>
           <!-- [JBPM-1290] Integrate example tests in automated testrun -->
           <excludes>
-            <exclude>org/jbpm/examples/taskmgmt/**</exclude>
             <exclude>org/jbpm/examples/websale/**</exclude>
           </excludes>
         </configuration>

Modified: jbpm3/trunk/modules/examples/src/test/java/org/jbpm/examples/taskmgmt/TaskAssignmentTest.java
===================================================================
--- jbpm3/trunk/modules/examples/src/test/java/org/jbpm/examples/taskmgmt/TaskAssignmentTest.java	2008-09-29 10:52:58 UTC (rev 2433)
+++ jbpm3/trunk/modules/examples/src/test/java/org/jbpm/examples/taskmgmt/TaskAssignmentTest.java	2008-09-29 10:55:21 UTC (rev 2434)
@@ -28,9 +28,11 @@
 import org.jbpm.graph.exe.Token;
 import org.jbpm.taskmgmt.exe.TaskInstance;
 
-public class TaskAssignmentTest extends TestCase {
+public class TaskAssignmentTest extends TestCase 
+{
 
-  public void testTaskAssignment() {
+  public void testTaskAssignment() 
+  {
     // The process shown below is based on the hello world process.
     // The state node is replaced by a task-node.  The task-node 
     // is a node in JPDL that represents a wait state and generates 
@@ -43,7 +45,7 @@
       "  </start-state>" +
       "  <task-node name='t'>" +
       "    <task name='change nappy'>" +
-      "      <assignment class='org.jbpm.tutorial.taskmgmt.NappyAssignmentHandler' />" +
+      "      <assignment class='org.jbpm.examples.taskmgmt.NappyAssignmentHandler' />" +
       "    </task>" +
       "    <transition to='end' />" +
       "  </task-node>" +
@@ -52,43 +54,38 @@
     );
     
     // Create an execution of the process definition.
-    ProcessInstance processInstance = 
-        new ProcessInstance(processDefinition);
+    ProcessInstance processInstance = new ProcessInstance(processDefinition);
     Token token = processInstance.getRootToken();
-    
-    // Let's start the process execution, leaving the start-state 
+
+    // Let's start the process execution, leaving the start-state
     // over its default transition.
     token.signal();
-    // The signal method will block until the process execution 
-    // enters a wait state.   In this case, that is the task-node.
+    // The signal method will block until the process execution
+    // enters a wait state. In this case, that is the task-node.
     assertSame(processDefinition.getNode("t"), token.getNode());
 
     // When execution arrived in the task-node, a task 'change nappy'
     // was created and the NappyAssignmentHandler was called to determine
-    // to whom the task should be assigned.  The NappyAssignmentHandler 
+    // to whom the task should be assigned. The NappyAssignmentHandler
     // returned 'papa'.
 
     // In a real environment, the tasks would be fetched from the
     // database with the methods in the org.jbpm.db.TaskMgmtSession.
-    // Since we don't want to include the persistence complexity in 
-    // this example, we just take the first task-instance of this 
+    // Since we don't want to include the persistence complexity in
+    // this example, we just take the first task-instance of this
     // process instance (we know there is only one in this test
     // scenario.
-    TaskInstance taskInstance = (TaskInstance)  
-        processInstance
-          .getTaskMgmtInstance()
-          .getTaskInstances()
-          .iterator().next();
+    TaskInstance taskInstance = (TaskInstance)processInstance.getTaskMgmtInstance().getTaskInstances().iterator().next();
 
     // Now, we check if the taskInstance was actually assigned to 'papa'.
-    assertEquals("papa", taskInstance.getActorId() );
-    
-    // Now suppose that 'papa' has done his duties and marks the task 
-    // as done. 
+    assertEquals("papa", taskInstance.getActorId());
+
+    // Now suppose that 'papa' has done his duties and marks the task
+    // as done.
     taskInstance.end();
     // Since this was the last (only) task to do, the completion of this
     // task triggered the continuation of the process instance execution.
-    
+
     assertSame(processDefinition.getNode("end"), token.getNode());
   }
 




More information about the jbpm-commits mailing list