TaskLifecycleTest: Add test for never-ready task

This commit is contained in:
Gian Merlino 2013-12-13 07:47:18 -08:00
parent 863012c384
commit 3b053a66ff
1 changed files with 14 additions and 0 deletions

View File

@ -293,6 +293,20 @@ public class TaskLifecycleTest
Assert.assertEquals("num segments nuked", 0, mdc.getNuked().size()); Assert.assertEquals("num segments nuked", 0, mdc.getNuked().size());
} }
@Test
public void testNeverReadyTask() throws Exception
{
final Task neverReadyTask = new DefaultObjectMapper().readValue(
"{\"type\":\"noop\", \"isReadyResult\":\"exception\"}\"",
Task.class
);
final TaskStatus status = runTask(neverReadyTask);
Assert.assertEquals("statusCode", TaskStatus.Status.FAILED, status.getStatusCode());
Assert.assertEquals("num segments published", 0, mdc.getPublished().size());
Assert.assertEquals("num segments nuked", 0, mdc.getNuked().size());
}
@Test @Test
public void testSimple() throws Exception public void testSimple() throws Exception
{ {