use of org.ow2.proactive.scheduler.common.job.factories.JobFactory in project scheduling by ow2-proactive.
the class TestWorkflowSubmission method testValid.
/**
* Submits a batch of valid workflow jobs,
* checks for success at the job creation
*/
private void testValid() throws Throwable {
Scheduler userInt = schedulerHelper.getSchedulerInterface();
for (int i = 0; i < jobs_valid; i++) {
String job_path = new File(jobs_path.toURI()).getAbsolutePath() + "/flow_valid_" + (i + 1) + ".xml";
Exception exc = null;
JobId job = null;
try {
job = userInt.submit(JobFactory.getFactory().createJob(job_path));
} catch (Exception e) {
exc = e;
} finally {
userInt.removeJob(job);
}
Assert.assertTrue("JobFactory returned null for valid job " + job_path, job != null);
Assert.assertTrue("JobFactory threw an exception for valid job " + job_path, exc == null);
}
SchedulerTHelper.log(jobs_valid + " valid jobs successfully created");
}
Aggregations