Search in sources :

Example 6 with CoordinatorWfActionBean

use of org.apache.oozie.CoordinatorWfActionBean in project oozie by apache.

the class TestCoordWfActionInfoXCommand method testActionMissing.

public void testActionMissing() throws CommandException {
    List<CoordinatorWfActionBean> coordWfActions = new CoordWfActionInfoXCommand(coordJob.getId(), "aa", 2, 3).call();
    assertEquals(3, coordWfActions.size());
    assertEquals(wfJobs.get(1).getId(), coordWfActions.get(0).getAction().getWfId());
    assertEquals(wfJobs.get(2).getId(), coordWfActions.get(1).getAction().getWfId());
    CoordinatorWfActionBean coordWfAction = coordWfActions.get(2);
    assertEquals(4, coordWfAction.getActionNumber());
    assertEquals(null, coordWfAction.getAction());
    String expectNullReason = CoordinatorWfAction.NullReason.ACTION_NULL.getNullReason("aa", wfJobs.get(3).getId());
    assertEquals(expectNullReason, coordWfAction.getNullReason());
}
Also used : CoordinatorWfActionBean(org.apache.oozie.CoordinatorWfActionBean)

Example 7 with CoordinatorWfActionBean

use of org.apache.oozie.CoordinatorWfActionBean in project oozie by apache.

the class MockCoordinatorEngineService method reset.

public static void reset() {
    did = null;
    offset = null;
    length = null;
    order = null;
    filter = null;
    coordJobs = new ArrayList<CoordinatorJob>();
    coordWfActions = new ArrayList<CoordinatorWfActionBean>();
    startedCoordJobs = new ArrayList<Boolean>();
    for (int i = 0; i < INIT_COORD_COUNT; i++) {
        coordJobs.add(createDummyCoordinatorJob(i));
        startedCoordJobs.add(false);
    }
    for (int i = 0; i < INIT_WF_ACTION_COUNT; i++) {
        coordWfActions.add(createDummyCoordWfAction("actionTest", i + 1));
    }
    String nullReason = CoordinatorWfAction.NullReason.ACTION_NULL.getNullReason("actionTest2", "wf1");
    coordWfActions.add(new CoordinatorWfActionBean(INIT_WF_ACTION_COUNT + 1, null, nullReason));
}
Also used : CoordinatorJob(org.apache.oozie.client.CoordinatorJob) CoordinatorWfActionBean(org.apache.oozie.CoordinatorWfActionBean)

Aggregations

CoordinatorWfActionBean (org.apache.oozie.CoordinatorWfActionBean)7 WorkflowActionBean (org.apache.oozie.WorkflowActionBean)3 ArrayList (java.util.ArrayList)1 CoordinatorActionBean (org.apache.oozie.CoordinatorActionBean)1 CoordinatorEngine (org.apache.oozie.CoordinatorEngine)1 CoordinatorEngineException (org.apache.oozie.CoordinatorEngineException)1 CoordinatorJob (org.apache.oozie.client.CoordinatorJob)1 CommandException (org.apache.oozie.command.CommandException)1 JPAExecutorException (org.apache.oozie.executor.jpa.JPAExecutorException)1 WorkflowActionGetJPAExecutor (org.apache.oozie.executor.jpa.WorkflowActionGetJPAExecutor)1 CoordinatorEngineService (org.apache.oozie.service.CoordinatorEngineService)1 JSONArray (org.json.simple.JSONArray)1 JSONObject (org.json.simple.JSONObject)1