final String jobId = wc.submit(conf);
assertNotNull(jobId);
WorkflowJob wf = wc.getJobInfo(jobId);
assertNotNull(wf);
assertEquals(WorkflowJob.Status.PREP, wf.getStatus());
boolean dateTest = wf.getLastModifiedTime().compareTo(wf.getCreatedTime()) >= 0 ? true : false;
assertEquals(true, dateTest);
wc.start(jobId);
wf = wc.getJobInfo(jobId);
Date lastModTime = wf.getLastModifiedTime();
wc.suspend(jobId);
wf = wc.getJobInfo(jobId);
dateTest = wf.getLastModifiedTime().compareTo(lastModTime) >= 0 ? true : false;
assertEquals(true, dateTest);
lastModTime = wf.getLastModifiedTime();
sleep(1000);
wc.resume(jobId);
wf = wc.getJobInfo(jobId);
dateTest = wf.getLastModifiedTime().compareTo(lastModTime) >= 0 ? true : false;
assertEquals(true, dateTest);
waitFor(600000, new Predicate() {
public boolean evaluate() throws Exception {
WorkflowJob wf = wc.getJobInfo(jobId);
return wf.getStatus() == WorkflowJob.Status.SUCCEEDED;
}
});
wf = wc.getJobInfo(jobId);
assertNotNull(wf);
assertEquals(WorkflowJob.Status.SUCCEEDED, wf.getStatus());
dateTest = wf.getLastModifiedTime().compareTo(wf.getEndTime()) >= 0 ? true : false;
assertEquals(true, dateTest);
}
finally {
LocalOozie.stop();
}