[jbpm-commits] JBoss JBPM SVN: r5310 - jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Jul 16 05:26:01 EDT 2009


Author: jbarrez
Date: 2009-07-16 05:26:01 -0400 (Thu, 16 Jul 2009)
New Revision: 5310

Added:
   jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkTest.java
Log:
Test for JBPM-2297

Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkTest.java	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkTest.java	2009-07-16 09:26:01 UTC (rev 5310)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+/**
+ * 
+ */
+package org.jbpm.test.activities;
+
+import org.jbpm.api.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Joram Barrez
+ */
+public class ForkTest extends JbpmTestCase {
+  
+  // Test for JBPM-2297
+  public void testBasicForkUsage() {
+    deployJpdlXmlString(
+      "<process name='sboxCreation' xmlns='http://jbpm.org/4.0/jpdl'>" +
+      "<start name='start'> " +
+      "   <transition to='fork (review)'/> " +
+      "</start> " +
+      "<fork name='fork (review)'> " +
+      "   <transition name='Reporting review' to='Review (risk)'/> " +
+      "   <transition name='Risk review' to='Review (reporting)'/> " +
+      "</fork> " +
+      "<task candidate-groups='risk-dept' name='Review (risk)'> " +
+      "   <transition name='Approve'  to='join (approved)'/> " +
+      "   <transition name='Reject'   to='Rejected by Risk'/> " +
+      "</task> " +
+      "<task candidate-groups='reporting-dept' name='Review (reporting)'> " +
+      "   <transition name='Approve' to='join (approved)'/> " +
+      "   <transition name='Reject' to='Rejected by Reporting'/> " +
+      "</task> " +
+      "<join name='join (approved)'> " +
+      "   <transition to='end1'/> " +
+      "</join> " +
+      "<end-cancel name='Rejected by Reporting'/> " +
+      "<end name='end1'/> " +
+      "<end-cancel name='Rejected by Risk'/> " +
+      "</process>");
+    
+    String processInstanceId = executionService.startProcessInstanceByKey("sboxCreation").getId();
+    Task riskTask = taskService.createTaskQuery().activityName("Review (risk)").uniqueResult();
+    Task reportTask = taskService.createTaskQuery().activityName("Review (reporting)").uniqueResult();
+    
+    taskService.completeTask(riskTask.getId(), "Approve");
+    taskService.completeTask(reportTask.getId(), "Reject");
+    
+    assertProcessInstanceEnded(processInstanceId);
+  }
+
+}



More information about the jbpm-commits mailing list