use of org.apache.oozie.BulkResponseInfo in project oozie by apache.
the class TestBulkMonitorJPAExecutor method testMultipleRecords.
public void testMultipleRecords() throws Exception {
String request = "bundle=" + bundleName + ";actionstatus=FAILED,KILLED;" + "startcreatedtime=2012-07-21T00:00Z;endcreatedtime=2012-07-22T02:00Z;" + "startscheduledtime=2012-07-20T23:00Z;endscheduledtime=2012-07-22T03:00Z";
BulkResponseInfo response = _execQuery(request);
List<BulkResponseImpl> brList = response.getResponses();
// 3 actions satisfy the conditions
assertEquals(3, brList.size());
assertEquals(3, response.getTotal());
List<String> possibleStatus = new ArrayList<String>(Arrays.asList("KILLED", "FAILED"));
List<String> resultStatus = new ArrayList<String>();
resultStatus.add(brList.get(0).getAction().getStatus().toString());
resultStatus.add(brList.get(1).getAction().getStatus().toString());
assertEquals(possibleStatus, resultStatus);
}
Aggregations