use of org.apache.oozie.executor.jpa.CoordActionGetForStartJPAExecutor in project oozie by apache.
the class TestCoordActionStartXCommand method testActionStartWithErrorReported.
/**
* Coord action XML contains non-supported parameterized action name and
* test that CoordActionStartXCommand stores error code and error message in
* action's table during error handling
*
* @throws IOException
* @throws JPAExecutorException
* @throws CommandException
*/
public void testActionStartWithErrorReported() throws IOException, JPAExecutorException, CommandException {
String actionId = new Date().getTime() + "-COORD-ActionStartCommand-C@1";
String wfApp = "<start to='${someParam}' />";
addRecordToActionTable(actionId, 1, wfApp);
new CoordActionStartXCommand(actionId, "me", "myapp", "myjob").call();
final JPAService jpaService = Services.get().get(JPAService.class);
CoordinatorActionBean action = jpaService.execute(new CoordActionGetForStartJPAExecutor(actionId));
if (action.getStatus() == CoordinatorAction.Status.SUBMITTED) {
fail("Expected status was FAILED due to incorrect XML element");
}
assertEquals(action.getErrorCode(), ErrorCode.E0701.toString());
assertTrue(action.getErrorMessage().contains("XML schema error, cvc-pattern-valid: Value '${someParam}' " + "is not facet-valid with respect to pattern"));
}
Aggregations