use of org.apache.oozie.service.Services in project oozie by apache.
the class TestActionStartXCommand method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
services = new Services();
services.init();
}
use of org.apache.oozie.service.Services in project oozie by apache.
the class TestActionUserRetry method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
setSystemProperty(SchemaService.WF_CONF_EXT_SCHEMAS, "wf-ext-schema.xsd");
setSystemProperty(LiteWorkflowStoreService.CONF_USER_RETRY_ERROR_CODE_EXT, ForTestingActionExecutor.TEST_ERROR);
setSystemProperty(Services.CONF_SERVICE_EXT_CLASSES, ExtendedCallableQueueService.class.getName());
services = new Services();
services.init();
services.get(ActionService.class).registerAndInitExecutor(ForTestingActionExecutor.class);
ConfigurationService.setBoolean(SignalXCommand.FORK_PARALLEL_JOBSUBMISSION, true);
}
use of org.apache.oozie.service.Services in project oozie by apache.
the class TestCoordRerunXCommand method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
services = new Services();
services.init();
LocalOozie.start();
}
use of org.apache.oozie.service.Services in project oozie by apache.
the class TestCoordRerunXCommand method testCoordRerunInDoneWithError.
/**
* Test : Rerun DONEWITHERROR coordinator job
*
* @throws Exception
*/
public void testCoordRerunInDoneWithError() throws Exception {
Services.get().destroy();
setSystemProperty(StatusTransitService.CONF_BACKWARD_SUPPORT_FOR_STATES_WITHOUT_ERROR, "false");
services = new Services();
services.init();
CoordinatorJobBean job = this.addRecordToCoordJobTable(Job.Status.DONEWITHERROR, false, false);
addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.FAILED, "coord-rerun-action1.xml", 0);
JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
job = getCoordinatorJob(job.getId());
assertEquals(Job.Status.DONEWITHERROR, job.getStatus());
new CoordRerunXCommand(job.getId(), RestConstants.JOB_COORD_SCOPE_DATE, "2009-12-15T01:00Z", false, true, false, null).call();
job = getCoordinatorJob(job.getId());
assertEquals(Job.Status.RUNNINGWITHERROR, job.getStatus());
}
use of org.apache.oozie.service.Services in project oozie by apache.
the class TestCoordRerunXCommand method testCoordRerunForBackwardSupport3.
/**
* Tests functionality of the coord rerun for backward support is true. </p> Insert a coordinator job with SUCCEEDED
* and coordinator actions with pending false. However, job's doneMaterialization is false to imitate update from
* 2.x to 3.0.1.
* Set oozie.service.StatusTransitService.backward.support.for.coord.status=true
* and use uri:oozie:coordinator:0.1 namespace, then, rerun the coord job for action 1 and action 2.
*
* @throws Exception
*/
public void testCoordRerunForBackwardSupport3() throws Exception {
Services.get().destroy();
setSystemProperty(StatusTransitService.CONF_BACKWARD_SUPPORT_FOR_COORD_STATUS, "true");
services = new Services();
services.init();
Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean coordJob = addRecordToCoordJobTable(CoordinatorJob.Status.SUCCEEDED, start, end, false, false, 3);
final JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
coordJob.setAppNamespace(SchemaService.COORDINATOR_NAMESPACE_URI_1);
CoordJobQueryExecutor.getInstance().executeUpdate(CoordJobQuery.UPDATE_COORD_JOB_APPNAMESPACE, coordJob);
CoordinatorActionBean action1 = addRecordToCoordActionTable(coordJob.getId(), 1, CoordinatorAction.Status.SUCCEEDED, "coord-rerun-action1.xml", 0);
CoordinatorActionBean action2 = addRecordToCoordActionTable(coordJob.getId(), 2, CoordinatorAction.Status.SUCCEEDED, "coord-rerun-action1.xml", 0);
CoordinatorActionBean action3 = addRecordToCoordActionTable(coordJob.getId(), 3, CoordinatorAction.Status.SUCCEEDED, "coord-rerun-action1.xml", 0);
String rerunScope = Integer.toString(1) + "-" + Integer.toString(2);
final OozieClient coordClient = LocalOozie.getCoordClient();
coordClient.reRunCoord(coordJob.getId(), RestConstants.JOB_COORD_SCOPE_ACTION, rerunScope, false, true);
coordJob = getCoordinatorJob(coordJob.getId());
assertEquals(CoordinatorJob.Status.SUCCEEDED, coordJob.getStatus());
action1 = getCoordinatorAction(action1.getId());
assertNotSame(action1.getStatus(), CoordinatorAction.Status.SUCCEEDED);
action2 = getCoordinatorAction(action2.getId());
assertNotSame(action2.getStatus(), CoordinatorAction.Status.SUCCEEDED);
}
Aggregations