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

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Jan 15 09:04:04 EST 2010


Author: jbarrez
Date: 2010-01-15 09:04:04 -0500 (Fri, 15 Jan 2010)
New Revision: 6083

Removed:
   jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/UserTaskTest.java
Log:
Removed test case since it tests an invalid bpmn2 process

Deleted: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/UserTaskTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/UserTaskTest.java	2010-01-14 23:09:03 UTC (rev 6082)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/UserTaskTest.java	2010-01-15 14:04:04 UTC (rev 6083)
@@ -1,252 +0,0 @@
-/*
- * 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.bpmn;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.jbpm.api.ProcessInstance;
-import org.jbpm.api.TaskQuery;
-import org.jbpm.api.task.Task;
-//import org.jbpm.bpmn.model.BpmnProcessDefinition;
-//import org.jbpm.bpmn.parser.BpmnParser;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.xml.Parse;
-import org.jbpm.test.JbpmTestCase;
-
-/**
- * @author Bernd Ruecker (bernd.ruecker at camunda.com)
- */
-public class UserTaskTest extends JbpmTestCase {
-
-//  static BpmnParser bpmnParser = new BpmnParser();
-//
-//  public void testParsing() {
-//    Parse parse = bpmnParser.createParse().setResource("org/jbpm/bpmn/UserTaskSimple.bpmn.xml").execute();
-//
-//    if (!parse.getProblems().isEmpty()) {
-//      fail("No problems should have occured. Problems: " + parse.getProblems());
-//    }
-//
-//    List<BpmnProcessDefinition> processDefinitions = (List<BpmnProcessDefinition>) parse.getDocumentObject();
-//
-//    assertEquals(1, processDefinitions.size());
-//
-//    BpmnProcessDefinition pd = processDefinitions.get(0);
-//    assertNotNull(pd);
-//    assertEquals("UserTaskSimpleProcess", pd.getKey());
-//  }
-
-  public void testNormalUserAssignment() {
-    String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/bpmn/UserTaskSimple.bpmn.xml").deploy();
-
-    try {
-      Map variables = new HashMap();
-      variables.put("assignedUser", "User1");
-      ProcessInstance pi = executionService.startProcessInstanceByKey("UserTaskSimpleProcess", variables);
-      assertEquals("UserTask", ((ExecutionImpl) pi).getActivityName());
-
-      TaskQuery taskQuery = taskService.createTaskQuery();
-      List<Task> allTasks = taskQuery.list();
-      assertEquals(1, allTasks.size());
-      assertEquals("UserTask", allTasks.get(0).getActivityName());
-      assertEquals("User1", allTasks.get(0).getAssignee());
-      assertEquals("MyForm.ftl", allTasks.get(0).getFormResourceName());
-
-      // speciifiing a transition is unnecessary, BPMN has outgoing AND
-      // semantic!
-      // TODO: fix
-      taskService.completeTask(allTasks.get(0).getId(), "flow2");
-
-      assertEquals(0, taskQuery.list().size());
-
-      // process instance is ended
-      pi = executionService.findProcessInstanceById(pi.getId());
-      // One way or another I would also expect this to work... pi is gone from
-      // database immediately when ended. Only in History DB
-      // assertEquals(true, pi.isEnded());
-      assertNull(pi);
-    } finally {
-      repositoryService.deleteDeploymentCascade(deploymentId);
-    }
-  }
-
-  /*
-  public void testNormalGroupAssignment() {
-    String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/bpmn/UserTaskGroup.bpmn.xml").deploy();
-
-    try {
-      Map<String, Object> variables = new HashMap<String, Object>();
-      variables.put("assignedGroup", "Group1");
-      ProcessInstance pi = executionService.startProcessInstanceByKey("UserTaskGroupProcess", variables);
-
-      assertEquals("UserTask", ((ExecutionImpl) pi).getActivityName());
-
-      TaskQuery taskQuery = taskService.createTaskQuery();
-      List<Task> allTasks = taskQuery.list();
-      assertEquals(1, allTasks.size());
-
-      List<Task> groupTasks = taskService.findGroupTasks("Group1");
-      assertEquals(1, groupTasks.size());
-      assertEquals("UserTask", groupTasks.get(0).getActivityName());
-
-      assertEquals("UserTask", allTasks.get(0).getActivityName());
-
-      assertNull(allTasks.get(0).getAssignee());
-
-      taskService.takeTask(allTasks.get(0).getId(), "User1");
-
-      groupTasks = taskService.findGroupTasks("Group1");
-      assertEquals(0, groupTasks.size());
-
-      List<Task> userTasks = taskService.findPersonalTasks("User1");
-      assertEquals(1, userTasks.size());
-      assertEquals("UserTask", userTasks.get(0).getActivityName());
-
-      taskService.completeTask(userTasks.get(0).getId(), "flow2");
-
-      assertEquals(0, taskQuery.list().size());
-
-      // process instance is ended
-      pi = executionService.findProcessInstanceById(pi.getId());
-      assertNull(pi);
-    } finally {
-      repositoryService.deleteDeploymentCascade(deploymentId);
-    }
-  }*/
-
-  public void testNormalSequenceFlowCondition() {
-    String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/bpmn/UserTaskSequenceFlowCondition.bpmn.xml").deploy();
-
-    try {
-      Map variables = new HashMap();
-      ProcessInstance pi = executionService.startProcessInstanceByKey("UserTaskSequenceFlowConditionProcess");
-
-      assertEquals("UserTask", ((ExecutionImpl) pi).getActivityName());
-
-      TaskQuery taskQuery = taskService.createTaskQuery();
-      List<Task> allTasks = taskQuery.list();
-      assertEquals(1, allTasks.size());
-
-      // Flow does not exist so task should be ended hence process endded since it is the only execution
-      taskService.completeTask(allTasks.get(0).getId(), "NoFlow");
-      
-      assertEquals(0, taskQuery.list().size());
-
-      // process instance is ended
-      pi = executionService.findProcessInstanceById(pi.getId());
-      assertNull(pi);
-    } finally {
-      repositoryService.deleteDeploymentCascade(deploymentId);
-    }
-  }
-
-  
-  
-  /**
-   * check that multiple outgoing sequence flows will be handled as fork, like
-   * specified in BPMN
-   * 
-   * Check with user tasks, sicne the engine stops there for sure.
-   */
-  public void testUncontrolledSequenceFlowAsFork() {
-    String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/bpmn/forkWithUncontrolledSequenceFlow.bpmn.xml")
-            .deploy();
-
-    try {
-
-      ProcessInstance pi = executionService.startProcessInstanceByKey("ForkWithUncontrolledSequenceFlowProcess");
-
-      String pid = pi.getId();
-
-      TaskQuery taskQuery = taskService.createTaskQuery();
-      List<Task> allTasks = taskQuery.list();
-
-      // since the uncontrolled sequence flow OUT of the activity behaves as a
-      // fork
-      // we now have two tasks
-      assertEquals(2, allTasks.size());
-      assertEquals("UserTaskLeg1", allTasks.get(0).getActivityName());
-      assertEquals("UserTaskLeg2", allTasks.get(1).getActivityName());
-
-      // specifying a transition is unnecessary, BPMN has outgoing AND semantic!
-      // TODO: fix
-      // Currently not passing any 'outcome'
-      taskService.completeTask(allTasks.get(0).getId()); // define output /
-      // flow?
-      taskService.completeTask(allTasks.get(1).getId());
-
-      assertEquals(0, taskQuery.list().size());
-
-      pi = executionService.findProcessInstanceById(pid);
-      // process instance is ended
-      assertNull(pi);
-
-    } finally {
-      repositoryService.deleteDeploymentCascade(deploymentId);
-    }
-
-  }
-
-  /**
-   * check that multiple outgoing sequence flows will be handled as fork, like
-   * specified in BPMN
-   * 
-   * Check with user tasks, sicne the engine stops there for sure.
-   */
-  public void testUncontrolledSequenceFlowConditionAsFork() {
-   /* String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/bpmn/forkWithUncontrolledSequenceFlowCondition.bpmn.xml")
-            .deploy();
-
-    try {
-
-      ProcessInstance pi = executionService.startProcessInstanceByKey("ForkWithUncontrolledSequenceFlowConditionProcess");
-
-      String pid = pi.getId();
-
-      TaskQuery taskQuery = taskService.createTaskQuery();
-      List<Task> allTasks = taskQuery.list();
-
-      assertEquals(1, allTasks.size());
-      assertEquals("forkingTask", allTasks.get(0).getActivityName());
-      taskService.completeTask(allTasks.get(0).getId(), "NoFlow");
-      
-      // Even though the 'uncontrolled sequence flow' OUT of the activity behaves as a
-      // fork we now have one task since one sequenceflow has a condition that evaluates to false
-
-      allTasks = taskQuery.list();
-      assertEquals(1, allTasks.size());
-      assertEquals("UserTaskLeg2", allTasks.get(0).getActivityName());
-      taskService.completeTask(allTasks.get(0).getId());
-
-      pi = executionService.findProcessInstanceById(pid);
-      // process instance is ended
-      assertNull(pi);
-
-    } finally {
-      repositoryService.deleteDeploymentCascade(deploymentId);
-    }*/
-
-  }
-  
-}



More information about the jbpm-commits mailing list