use of org.apache.oozie.SLAEventBean in project oozie by apache.
the class TestCoordMaterializeTransitionXCommand method checkCoordAction.
private CoordinatorActionBean checkCoordAction(String actionId) throws JPAExecutorException {
long[] lastSeqId = new long[1];
JPAService jpaService = Services.get().get(JPAService.class);
List<SLAEventBean> slaEventList = jpaService.execute(new SLAEventsGetForSeqIdJPAExecutor(-1, 10, lastSeqId));
if (slaEventList.size() == 0) {
fail("Unable to GET any record of sequence id greater than 0");
}
CoordinatorActionBean actionBean;
actionBean = jpaService.execute(new CoordActionGetJPAExecutor(actionId));
return actionBean;
}
use of org.apache.oozie.SLAEventBean in project oozie by apache.
the class TestSLAEventsGetForFilterJPAExecutor method testGetSLAEventsForCoordJobId.
public void testGetSLAEventsForCoordJobId() throws Exception {
Map<String, List<String>> filterListJob1 = createFilterList("jobid", coordId1);
JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
// Use -1 instead of 0 because HSQLDB starts the event_id generator at 0 instead of 1
SLAEventsGetForFilterJPAExecutor slaEventsGetCmd = new SLAEventsGetForFilterJPAExecutor(-1, 100, filterListJob1, new long[1]);
List<SLAEventBean> list = jpaService.execute(slaEventsGetCmd);
assertNotNull(list);
assertEquals(1, list.size());
}
use of org.apache.oozie.SLAEventBean in project oozie by apache.
the class TestSLAEventsGetForFilterJPAExecutor method testGetSLAEventsForAppName.
public void testGetSLAEventsForAppName() throws Exception {
Map<String, List<String>> filterListApp2 = createFilterList("appname", appName2);
JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
SLAEventsGetForFilterJPAExecutor slaEventsGetCmd = new SLAEventsGetForFilterJPAExecutor(0, 100, filterListApp2, new long[1]);
List<SLAEventBean> list = jpaService.execute(slaEventsGetCmd);
assertNotNull(list);
assertEquals(2, list.size());
}
use of org.apache.oozie.SLAEventBean in project oozie by apache.
the class TestSLAEventsGetForFilterJPAExecutor method testGetSLAEventsForOR.
public void testGetSLAEventsForOR() throws Exception {
Map<String, List<String>> filterList = createFilterList("jobid", coordId1, coordActionId1);
JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
// Use -1 instead of 0 because HSQLDB starts the event_id generator at 0 instead of 1
SLAEventsGetForFilterJPAExecutor slaEventsGetCmd = new SLAEventsGetForFilterJPAExecutor(-1, 100, filterList, new long[1]);
List<SLAEventBean> list = jpaService.execute(slaEventsGetCmd);
assertNotNull(list);
assertEquals(4, list.size());
}
use of org.apache.oozie.SLAEventBean in project oozie by apache.
the class TestSLAEventsGetForFilterJPAExecutor method testGetSLAEventsForCombined.
public void testGetSLAEventsForCombined() throws Exception {
Map<String, List<String>> filterList = createFilterList("jobid", coordId1, coordActionId1);
filterList.put("appname", Arrays.asList(new String[] { appName1 }));
JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
long[] lastSeqId = new long[1];
lastSeqId[0] = -1;
// Use -1 instead of 0 because HSQLDB starts the event_id generator at 0 instead of 1
SLAEventsGetForFilterJPAExecutor slaEventsGetCmd = new SLAEventsGetForFilterJPAExecutor(-1, 100, filterList, lastSeqId);
List<SLAEventBean> list = jpaService.execute(slaEventsGetCmd);
assertNotNull(list);
assertEquals(4, list.size());
}
Aggregations