use of org.apache.oozie.BundleJobInfo in project oozie by apache.
the class TestBundleJobsXCommand method _testGetJobsForGroup.
private void _testGetJobsForGroup() throws Exception {
Map<String, List<String>> filter = new HashMap<String, List<String>>();
List<String> list = new ArrayList<String>();
list.add(getTestGroup());
filter.put(OozieClient.FILTER_GROUP, list);
BundleJobsXCommand bundlesGetCmd = new BundleJobsXCommand(filter, 1, 20);
BundleJobInfo ret = bundlesGetCmd.call();
assertNotNull(ret);
assertEquals(4, ret.getBundleJobs().size());
}
use of org.apache.oozie.BundleJobInfo in project oozie by apache.
the class TestBundleJobsXCommand method _testGetJobsForAppName.
private void _testGetJobsForAppName() throws Exception {
Map<String, List<String>> filter = new HashMap<String, List<String>>();
List<String> list = new ArrayList<String>();
list.add("BUNDLE-TEST");
filter.put(OozieClient.FILTER_NAME, list);
BundleJobsXCommand bundlesGetCmd = new BundleJobsXCommand(filter, 1, 20);
BundleJobInfo ret = bundlesGetCmd.call();
assertNotNull(ret);
assertEquals(6, ret.getBundleJobs().size());
}
use of org.apache.oozie.BundleJobInfo in project oozie by apache.
the class TestBundleJobInfoGetJPAExecutor method _testGetJobInfoForStatus.
private void _testGetJobInfoForStatus() throws Exception {
JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
Map<String, List<String>> filter = new HashMap<String, List<String>>();
List<String> list = new ArrayList<String>();
list.add("RUNNING");
list.add("PREP");
filter.put(OozieClient.FILTER_STATUS, list);
BundleJobInfoGetJPAExecutor bundleInfoGetCmd = new BundleJobInfoGetJPAExecutor(filter, 1, 20);
BundleJobInfo ret = jpaService.execute(bundleInfoGetCmd);
assertNotNull(ret);
assertEquals(2, ret.getBundleJobs().size());
}
use of org.apache.oozie.BundleJobInfo in project oozie by apache.
the class TestBundleJobInfoGetJPAExecutor method testBundleJobsSortBy.
public void testBundleJobsSortBy() throws Exception {
BundleJobBean bundleJob1 = addRecordToBundleJobTable(Job.Status.PREP, false);
BundleJobBean bundleJob2 = addRecordToBundleJobTable(Job.Status.RUNNING, false);
bundleJob1.setLastModifiedTime(DateUtils.parseDateUTC("2012-01-04T10:00Z"));
bundleJob1.setCreatedTime(DateUtils.parseDateUTC("2012-01-03T10:00Z"));
BundleJobQueryExecutor.getInstance().executeUpdate(BundleJobQueryExecutor.BundleJobQuery.UPDATE_BUNDLE_JOB, bundleJob1);
bundleJob2.setLastModifiedTime(DateUtils.parseDateUTC("2012-01-05T10:00Z"));
bundleJob2.setCreatedTime(DateUtils.parseDateUTC("2012-01-02T10:00Z"));
BundleJobQueryExecutor.getInstance().executeUpdate(BundleJobQueryExecutor.BundleJobQuery.UPDATE_BUNDLE_JOB, bundleJob2);
JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
Map<String, List<String>> filter = new HashMap<String, List<String>>();
List<String> list = new ArrayList<String>();
list.add("lastmodifiedTime");
filter.put(OozieClient.FILTER_SORT_BY, list);
BundleJobInfoGetJPAExecutor bundleInfoGetCmd = new BundleJobInfoGetJPAExecutor(filter, 1, 20);
BundleJobInfo ret = jpaService.execute(bundleInfoGetCmd);
assertNotNull(ret);
assertEquals(2, ret.getBundleJobs().size());
compareBundleJobs(bundleJob2, ret.getBundleJobs().get(0));
// test the default behavior
filter.clear();
list.clear();
bundleInfoGetCmd = new BundleJobInfoGetJPAExecutor(filter, 1, 20);
ret = jpaService.execute(bundleInfoGetCmd);
assertNotNull(ret);
assertEquals(2, ret.getBundleJobs().size());
compareBundleJobs(bundleJob1, ret.getBundleJobs().get(0));
}
use of org.apache.oozie.BundleJobInfo in project oozie by apache.
the class TestBundleJobInfoGetJPAExecutor method _testGetJobInfoForAppName.
private void _testGetJobInfoForAppName() throws Exception {
JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
Map<String, List<String>> filter = new HashMap<String, List<String>>();
List<String> list = new ArrayList<String>();
list.add("BUNDLE-TEST");
filter.put(OozieClient.FILTER_NAME, list);
BundleJobInfoGetJPAExecutor bundleInfoGetCmd = new BundleJobInfoGetJPAExecutor(filter, 1, 20);
BundleJobInfo ret = jpaService.execute(bundleInfoGetCmd);
assertNotNull(ret);
assertEquals(4, ret.getBundleJobs().size());
}
Aggregations