Search in sources :

Example 6 with TaskState

use of org.apache.helix.task.TaskState in project helix by apache.

the class TestWorkflowAndJobPoll method testJobPoll.

@Test
public void testJobPoll() throws InterruptedException {
    String jobResource = TestHelper.getTestMethodName();
    Workflow.Builder builder = WorkflowGenerator.generateDefaultSingleJobWorkflowBuilder(jobResource);
    _driver.start(builder.build());
    TaskState polledState = _driver.pollForJobState(jobResource, String.format("%s_%s", jobResource, jobResource), 4000L, TaskState.COMPLETED, TaskState.FAILED);
    Assert.assertEquals(TaskState.COMPLETED, polledState);
}
Also used : Workflow(org.apache.helix.task.Workflow) TaskState(org.apache.helix.task.TaskState) Test(org.testng.annotations.Test)

Aggregations

TaskState (org.apache.helix.task.TaskState)6 Workflow (org.apache.helix.task.Workflow)3 WorkflowContext (org.apache.helix.task.WorkflowContext)3 Test (org.testng.annotations.Test)3 JobConfig (org.apache.helix.task.JobConfig)2 JobContext (org.apache.helix.task.JobContext)2 TaskConfig (org.apache.helix.task.TaskConfig)2 TaskPartitionState (org.apache.helix.task.TaskPartitionState)2 WorkflowConfig (org.apache.helix.task.WorkflowConfig)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 ZNRecord (org.apache.helix.ZNRecord)1