Search in sources :

Example 11 with BulkResponseInfo

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);
}
Also used : BulkResponseImpl(org.apache.oozie.client.rest.BulkResponseImpl) BulkResponseInfo(org.apache.oozie.BulkResponseInfo) ArrayList(java.util.ArrayList)

Aggregations

BulkResponseInfo (org.apache.oozie.BulkResponseInfo)11 BulkResponseImpl (org.apache.oozie.client.rest.BulkResponseImpl)8 ArrayList (java.util.ArrayList)3 BundleJobBean (org.apache.oozie.BundleJobBean)2 BulkJPAExecutor (org.apache.oozie.executor.jpa.BulkJPAExecutor)2 JPAService (org.apache.oozie.service.JPAService)2 Timestamp (java.sql.Timestamp)1 ParseException (java.text.ParseException)1 HashMap (java.util.HashMap)1 BaseEngineException (org.apache.oozie.BaseEngineException)1 BundleEngine (org.apache.oozie.BundleEngine)1 XException (org.apache.oozie.XException)1 CommandException (org.apache.oozie.command.CommandException)1 BundleJobInsertJPAExecutor (org.apache.oozie.executor.jpa.BundleJobInsertJPAExecutor)1 JPAExecutorException (org.apache.oozie.executor.jpa.JPAExecutorException)1 BundleEngineService (org.apache.oozie.service.BundleEngineService)1 JSONObject (org.json.simple.JSONObject)1