TaskExecutionState implements java.io.Serializable { @Override public int hashCode() { return jobID.hashCode() + executionId.hashCode() + executionState.ordinal(); } TaskExecutionState(JobID jobID, ExecutionAttemptID executionId, ExecutionState executionState);  TaskExecutionState(JobID jobID, ExecutionAttemptID executionId,
							ExecutionState executionState, Throwable error);  TaskExecutionState(JobID jobID, ExecutionAttemptID executionId,
			ExecutionState executionState, Throwable error,
			AccumulatorSnapshot accumulators); Throwable getError(ClassLoader userCodeClassloader); ExecutionAttemptID getID(); ExecutionState getExecutionState(); JobID getJobID(); AccumulatorSnapshot getAccumulators(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void testEqualsHashCode() { try { final JobID jid = new JobID(); final ExecutionAttemptID executionId = new ExecutionAttemptID(); final ExecutionState state = ExecutionState.RUNNING; final Throwable error = new RuntimeException("some test error message"); TaskExecutionState s1 = new TaskExecutionState(jid, executionId, state, error); TaskExecutionState s2 = new TaskExecutionState(jid, executionId, state, error); assertEquals(s1.hashCode(), s2.hashCode()); assertEquals(s1, s2); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } }
@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); assertEquals(original1, javaSerCopy1); assertEquals(javaSerCopy1, original1); assertEquals(original2, javaSerCopy2); assertEquals(javaSerCopy2, original2); assertEquals(original1.hashCode(), javaSerCopy1.hashCode()); assertEquals(original2.hashCode(), javaSerCopy2.hashCode()); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } }