ESTaskStatus { public TaskStatus getStatus() throws IllegalStateException { try { return state.get(getKey()); } catch (IOException e) { throw new IllegalStateException("Unable to get task status from zookeeper", e); } } ESTaskStatus(SerializableState state, FrameworkID frameworkID, TaskInfo taskInfo, StatePath statePath); void setStatus(TaskStatus status); TaskStatus getStatus(); TaskStatus getDefaultStatus(); TaskInfo getTaskInfo(); @Override String toString(); boolean taskInError(); static boolean errorState(TaskState state); void destroy(); static final String STATE_KEY; static final String DEFAULT_STATUS_NO_MESSAGE_SET; }
@Test(expected = IllegalStateException.class) public void testHandleGetException() throws IllegalStateException, IOException { doThrow(IOException.class).when(state).get(anyString()); status.getStatus(); }