[jbpm-commits] JBoss JBPM SVN: r4394 - in jbpm4/trunk/modules/examples/src/test: java/org/jbpm/examples/task/swimlane and 2 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Apr 2 15:34:49 EDT 2009


Author: heiko.braun at jboss.com
Date: 2009-04-02 15:34:49 -0400 (Thu, 02 Apr 2009)
New Revision: 4394

Modified:
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/candidates/process.jpdl.xml
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/swimlane/process.jpdl.xml
Log:
Make sure test identities are created only a single time

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java	2009-04-02 17:54:53 UTC (rev 4393)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java	2009-04-02 19:34:49 UTC (rev 4394)
@@ -36,7 +36,20 @@
   protected void setUp() throws Exception
   {
     super.setUp();
+
     deploy("jbpm-TaskCandidatesTest.jar");
+
+    if(identityService.findGroupById("sales-test-group")==null)
+    {
+      // create johndoe and joesmoe as members of the sales group
+      identityService.createGroup("sales-test-group");
+
+      identityService.createUser("johndoe", "johndoe", "John", "Doe");
+      identityService.createMembership("johndoe", "sales-test-group");
+
+      identityService.createUser("joesmoe", "joesmoe", "Joe", "Smoe");
+      identityService.createMembership("joesmoe", "sales-test-group");
+    }
   }
 
   protected void tearDown() throws Exception
@@ -46,21 +59,12 @@
   }
 
   public void testGroupCandidateAssignment() {
-    // create johndoe and joesmoe as members of the sales group
-    identityService.createGroup("sales");
-
-    identityService.createUser("johndoe", "johndoe", "John", "Doe");
-    identityService.createMembership("johndoe", "sales");
-
-    identityService.createUser("joesmoe", "joesmoe", "Joe", "Smoe");
-    identityService.createMembership("joesmoe", "sales");
-    
     Execution execution = executionService.startProcessInstanceByKey("TaskCandidates");
     String executionId = execution.getId();
 
     // both johndoe and joesmoe will see the task in their *takable* task list 
     List<Task> taskList = taskService.findTakableTasks("johndoe");
-    assertEquals("Expected a single task in johndoe's takable task list", 1, taskList.size());
+    assertEquals("Expected a single task in johndoe's task list", 1, taskList.size());
     Task task = taskList.get(0);
     assertEquals("review", task.getName());
 

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java	2009-04-02 17:54:53 UTC (rev 4393)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java	2009-04-02 19:34:49 UTC (rev 4394)
@@ -36,6 +36,15 @@
   {
     super.setUp();
     deploy("jbpm-TaskSwimlaneTest.jar");
+
+    if(identityService.findGroupById("sales-test-group")==null)
+    {
+      // create johndoe and joesmoe as members of the sales group
+      identityService.createGroup("sales-test-group");
+
+      identityService.createUser("johndoe", "johndoe", "John", "Doe");
+      identityService.createMembership("johndoe", "sales-test-group");
+    }
   }
 
   protected void tearDown() throws Exception
@@ -44,15 +53,11 @@
     super.tearDown();
   }
 
-  public void testTaskSwimlane() {
-    identityService.createGroup("sales");
-    identityService.createUser("johndoe", "johndoe", "John", "Doe");
-    identityService.createMembership("johndoe", "sales");
-    
+  public void testTaskSwimlane() {    
     executionService.startProcessInstanceByKey("TaskSwimlane");
 
     List<Task> taskList = taskService.findTakableTasks("johndoe");
-    assertEquals(1, taskList.size());
+    assertEquals("Expected a single task in johndoe's task list", 1, taskList.size());
     Task task = taskList.get(0);
     long taskDbid = task.getDbid();
     assertEquals("enter order data", task.getName());

Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/candidates/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/candidates/process.jpdl.xml	2009-04-02 17:54:53 UTC (rev 4393)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/candidates/process.jpdl.xml	2009-04-02 19:34:49 UTC (rev 4394)
@@ -7,7 +7,7 @@
   </start>
 
   <task name="review" 
-        candidate-groups="sales"
+        candidate-groups="sales-test-group"
         g="96,16,127,52">
  
      <transition to="wait" />

Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/swimlane/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/swimlane/process.jpdl.xml	2009-04-02 17:54:53 UTC (rev 4393)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/swimlane/process.jpdl.xml	2009-04-02 19:34:49 UTC (rev 4394)
@@ -3,7 +3,7 @@
 <process name="TaskSwimlane" xmlns="http://jbpm.org/4/jpdl">
 
   <swimlane name="sales representative"
-            candidate-groups="sales" />
+            candidate-groups="sales-test-group" />
 
   <start g="20,20,48,48">
     <transition to="enter order data" />




More information about the jbpm-commits mailing list