assertEquals("myTask", task.getName());
assertEquals("end", task.getEventName());
}
public void testExecutionEntitySerialization() throws Exception {
ExecutionEntity execution = new ExecutionEntity();
ActivityImpl activityImpl = new ActivityImpl("test", null);
activityImpl.getExecutionListeners().put("start", Collections.<ExecutionListener>singletonList(new TestExecutionListener()));
execution.setActivity(activityImpl);
ProcessDefinitionImpl processDefinitionImpl = new ProcessDefinitionImpl("test");
processDefinitionImpl.getExecutionListeners().put("start", Collections.<ExecutionListener>singletonList(new TestExecutionListener()));
execution.setProcessDefinition(processDefinitionImpl);
TransitionImpl transitionImpl = new TransitionImpl("test", new ProcessDefinitionImpl("test"));
transitionImpl.addExecutionListener(new TestExecutionListener());
execution.setTransition(transitionImpl);
execution.setTransitionBeingTaken(transitionImpl);
execution.getProcessInstanceStartContext().setInitial(activityImpl);
execution.setSuperExecution(new ExecutionEntity());
execution.setActive(true);
execution.setCanceled(false);
execution.setBusinessKey("myBusinessKey");
execution.setDeleteReason("no reason");
execution.setActivityInstanceId("123");
execution.setScope(false);
byte[] data = writeObject(execution);
execution = (ExecutionEntity) readObject(data);
assertEquals("myBusinessKey", execution.getBusinessKey());
assertEquals("no reason", execution.getDeleteReason());
assertEquals("123", execution.getActivityInstanceId());
}