Search in sources :

Example 6 with JobFactory

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");
}
Also used : Scheduler(org.ow2.proactive.scheduler.common.Scheduler) File(java.io.File) JobId(org.ow2.proactive.scheduler.common.job.JobId)

Aggregations

JobCreationException (org.ow2.proactive.scheduler.common.exception.JobCreationException)5 Job (org.ow2.proactive.scheduler.common.job.Job)3 TaskFlowJob (org.ow2.proactive.scheduler.common.job.TaskFlowJob)3 JobFactory (org.ow2.proactive.scheduler.common.job.factories.JobFactory)3 JobValidationData (org.ow2.proactive_grid_cloud_portal.scheduler.dto.JobValidationData)3 Constructor (java.lang.reflect.Constructor)2 File (java.io.File)1 Scheduler (org.ow2.proactive.scheduler.common.Scheduler)1 JobId (org.ow2.proactive.scheduler.common.job.JobId)1