Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.jbpm.integration.console;
  
  import static org.junit.Assert.assertEquals;
  
  import java.util.HashMap;
  import java.util.List;
  
  import  org.jboss.bpm.console.client.model.ProcessInstanceRef;
  import  org.jboss.bpm.console.client.model.ProcessInstanceRef.RESULT;
 import  org.jboss.bpm.console.client.model.ProcessInstanceRef.STATE;
 import org.junit.Test;
 
 public class ProcessManagementTest extends JbpmTestCase {
 
 
 	public void instantiateProcesses() {
 		HashMap<StringObjectvariables = new HashMap<StringObject>();
 		variables.put("key""variable");
 		.newInstance("UserTask"variables);
 		.newInstance("UserTask"variables);
 	}
 
 	public void clearProcesses() {
 		 = null;
 	}
 
 	@Test
 	public void testGetProcessDefinitions() {
 		assertEquals("UserTask".getProcessDefinitions().get(0).getId());
 		assertEquals("Minimal".getProcessDefinitions().get(1).getId());
 	}
 
 	@Test
 	public void testGetProcessDefinition() {
 		assertEquals("UserTask".getProcessDefinition("UserTask").getId());
 	}
 
 	@Test(expected = UnsupportedOperationException.class)
 	public void testRemoveProcessDefinition() {
 	}
 
 	public void testGetProcessInstances() {
 		List<ProcessInstanceRef> userTaskInstances = .getProcessInstances("UserTask");
 		List<ProcessInstanceRef> minimalInstances = .getProcessInstances("Minimal");
 		assertEquals(2, userTaskInstances.size());
 		assertEquals(0, minimalInstances.size());
 	}
 
 	public void testNewProcessInstance() {
 		assertEquals("UserTask".newInstance("UserTask").getDefinitionId());
 	}
 
 		HashMap<StringObjectvariables = new HashMap<StringObject>();
 		variables.put("key2""variable2");
 		ProcessInstanceRef instanceRef = .newInstance("UserTask",	variables);
 		assertEquals("UserTask"instanceRef.getDefinitionId());
 		assertEquals("variable2".getInstanceData(instanceRef.getId()).get("key2"));
 	}
 
 	@Test(expected = UnsupportedOperationException.class)
 	public void testSetProcessState() {
 		.setProcessState("23", STATE.RUNNING);
 	}
 
 	@Test
 	public void testGetInstanceData() {
 		HashMap<StringObjectvariables = new HashMap<StringObject>();
 		variables.put("key2""variable2");
 		String instanceID = .newInstance("UserTask"variables).getId();
 		assertEquals(variables.getInstanceData(instanceID));
 	}
 
 	@Test
 	public void testSetInstanceData() {
 		HashMap<StringObjectvariables = new HashMap<StringObject>();
 		variables.put("key""variable2");
 		String instanceID = .newInstance("UserTask"variables).getId();
 		variables.put("key3""variable3");
 		.setInstanceData(instanceIDvariables);
 		assertEquals(variables.getInstanceData(instanceID));
	}
	public void testSignalExecution() {
		// TODO implement
	}
	@Test(expected = IllegalArgumentException.class)
	public void testDeleteInstance() {
		HashMap<StringObjectvariables = new HashMap<StringObject>();
		variables.put("key3""variable3");
		String instanceID = .newInstance("UserTask"variables).getId();
	}
	@Test(expected = IllegalArgumentException.class)
	public void testEndInstance() {
		HashMap<StringObjectvariables = new HashMap<StringObject>();
		variables.put("key3""variable3");
		String instanceID = .newInstance("UserTask"variables).getId();
		.endInstance(instanceID, RESULT.ERROR);
	}
New to GrepCode? Check out our FAQ X