import org.camunda.bpm.engine.task.DelegationState;
public class ObjectSerializableTest extends TestCase {
public void testTaskEntitySerialization() throws Exception {
TaskEntity task = new TaskEntity();
task.setDelegationState(DelegationState.RESOLVED);
task.setExecution(new ExecutionEntity());
task.setProcessInstance(new ExecutionEntity());
task.setTaskDefinition(new TaskDefinition(null));
task.setAssignee("kermit");
task.setCreateTime(new Date());
task.setDescription("Test description");
task.setDueDate(new Date());
task.setName("myTask");
task.setEventName("end");
task.setDeleted(false);
task.setDelegationStateString(DelegationState.RESOLVED.name());
byte[] data = writeObject(task);
task = (TaskEntity) readObject(data);
assertEquals("kermit", task.getAssignee());
assertEquals("myTask", task.getName());
assertEquals("end", task.getEventName());
}