use of org.apache.oozie.BundleJobBean in project oozie by apache.
the class TestBulkBundleXCommand method testBulkBundleSuspendNegative.
public void testBulkBundleSuspendNegative() throws Exception {
BundleJobBean job1 = this.addRecordToBundleJobTable(Job.Status.RUNNING, false);
BundleJobBean job2 = this.addRecordToBundleJobTable(Job.Status.KILLED, false);
Map<String, List<String>> map = new HashMap<String, List<String>>();
List<String> names = new ArrayList<String>();
names.add("BUNDLE");
map.put("name", names);
new BulkBundleXCommand(map, 1, 10, OperationType.Suspend).call();
verifyJobStatus(job1.getId(), BundleJob.Status.RUNNING);
verifyChildrenStatus(job1.getId(), CoordinatorJob.Status.RUNNING);
verifyJobStatus(job2.getId(), BundleJob.Status.KILLED);
verifyChildrenStatus(job2.getId(), CoordinatorJob.Status.KILLED);
}
use of org.apache.oozie.BundleJobBean in project oozie by apache.
the class TestBulkBundleXCommand method testBulkBundleKillNegative.
public void testBulkBundleKillNegative() throws Exception {
BundleJobBean job1 = this.addRecordToBundleJobTable(Job.Status.RUNNING, false);
BundleJobBean job2 = this.addRecordToBundleJobTable(Job.Status.RUNNING, false);
Map<String, List<String>> map = new HashMap<String, List<String>>();
List<String> names = new ArrayList<String>();
names.add("BUNDLE");
map.put("name", names);
new BulkBundleXCommand(map, 1, 50, OperationType.Kill).call();
verifyJobStatus(job1.getId(), BundleJob.Status.RUNNING);
verifyChildrenStatus(job1.getId(), CoordinatorJob.Status.RUNNING);
verifyJobStatus(job2.getId(), BundleJob.Status.RUNNING);
verifyChildrenStatus(job2.getId(), CoordinatorJob.Status.RUNNING);
}
use of org.apache.oozie.BundleJobBean in project oozie by apache.
the class TestBulkBundleXCommand method verifyJobStatus.
private void verifyJobStatus(String jobId, BundleJob.Status status) throws Exception {
BundleJobBean job = BundleJobQueryExecutor.getInstance().get(BundleJobQueryExecutor.BundleJobQuery.GET_BUNDLE_JOB, jobId);
assertEquals(status, job.getStatus());
}
use of org.apache.oozie.BundleJobBean in project oozie by apache.
the class TestBulkBundleXCommand method testBulkBundleSuspendResumeKillSuccess.
public void testBulkBundleSuspendResumeKillSuccess() throws Exception {
BundleJobBean job1 = this.addRecordToBundleJobTable(Job.Status.RUNNING, false);
BundleJobBean job2 = this.addRecordToBundleJobTable(Job.Status.RUNNING, false);
Map<String, List<String>> map = new HashMap<String, List<String>>();
List<String> names = new ArrayList<String>();
names.add("BUNDLE-TEST");
map.put("name", names);
new BulkBundleXCommand(map, 1, 50, OperationType.Suspend).call();
verifyJobStatus(job1.getId(), BundleJob.Status.SUSPENDED);
verifyChildrenStatus(job1.getId(), CoordinatorJob.Status.SUSPENDED);
verifyJobStatus(job2.getId(), BundleJob.Status.SUSPENDED);
verifyChildrenStatus(job2.getId(), CoordinatorJob.Status.SUSPENDED);
new BulkBundleXCommand(map, 1, 50, OperationType.Resume).call();
verifyJobStatus(job1.getId(), BundleJob.Status.RUNNING);
verifyChildrenStatus(job1.getId(), CoordinatorJob.Status.RUNNING);
verifyJobStatus(job2.getId(), BundleJob.Status.RUNNING);
verifyChildrenStatus(job2.getId(), CoordinatorJob.Status.RUNNING);
new BulkBundleXCommand(map, 1, 50, OperationType.Kill).call();
verifyJobStatus(job1.getId(), BundleJob.Status.KILLED);
verifyChildrenStatus(job1.getId(), CoordinatorJob.Status.KILLED);
verifyJobStatus(job2.getId(), BundleJob.Status.KILLED);
verifyChildrenStatus(job2.getId(), CoordinatorJob.Status.KILLED);
}
use of org.apache.oozie.BundleJobBean in project oozie by apache.
the class TestBulkBundleXCommand method testBulkBundleResumeNegative.
public void testBulkBundleResumeNegative() throws Exception {
BundleJobBean job1 = this.addRecordToBundleJobTable(Job.Status.RUNNING, false);
BundleJobBean job2 = this.addRecordToBundleJobTable(Job.Status.SUSPENDED, false);
Map<String, List<String>> map = new HashMap<String, List<String>>();
List<String> names = new ArrayList<String>();
names.add("BUNDLE");
map.put("name", names);
new BulkBundleXCommand(map, 1, 10, OperationType.Resume).call();
verifyJobStatus(job1.getId(), BundleJob.Status.RUNNING);
verifyChildrenStatus(job1.getId(), CoordinatorJob.Status.RUNNING);
verifyJobStatus(job2.getId(), BundleJob.Status.SUSPENDED);
verifyChildrenStatus(job2.getId(), CoordinatorJob.Status.SUSPENDED);
}
Aggregations