@Test
public void testSerialization() {

	try {
		final JobID jid = new JobID();
		final ExecutionAttemptID executionId = new ExecutionAttemptID();
		final ExecutionState state = ExecutionState.DEPLOYING;
		final Throwable error = new IOException("fubar");
		
		TaskExecutionState original1 = new TaskExecutionState(jid, executionId, state, error);
		TaskExecutionState original2 = new TaskExecutionState(jid, executionId, state);
		
		TaskExecutionState javaSerCopy1 = CommonTestUtils.createCopySerializable(original1);
		TaskExecutionState javaSerCopy2 = CommonTestUtils.createCopySerializable(original2);
		// equalities
		assertEquals(original1, javaSerCopy1);
		assertEquals(javaSerCopy1, original1);
		assertEquals(original2, javaSerCopy2);
		assertEquals(javaSerCopy2, original2);
		// hash codes
		assertEquals(original1.hashCode(), javaSerCopy1.hashCode());
		assertEquals(original2.hashCode(), javaSerCopy2.hashCode());
	}
	catch (Exception e) {
		e.printStackTrace();
		fail(e.getMessage());
	}
}