/** * Add a new controlled job. * @param aJob the new controlled job */ synchronized public String addJob(ControlledJob aJob) { String id = this.getNextJobID(); aJob.setJobID(id); aJob.setJobState(State.WAITING); jobsInProgress.add(aJob); return id; }
/** * Add a new controlled job. * @param aJob the new controlled job */ synchronized public String addJob(ControlledJob aJob) { String id = this.getNextJobID(); aJob.setJobID(id); aJob.setJobState(State.WAITING); jobsInProgress.add(aJob); return id; }
/** * Add a new controlled job. * @param aJob the new controlled job */ synchronized public String addJob(ControlledJob aJob) { String id = this.getNextJobID(); aJob.setJobID(id); aJob.setJobState(State.WAITING); jobsInProgress.add(aJob); return id; }
/** * Add a new controlled job. * @param aJob the new controlled job */ synchronized public String addJob(ControlledJob aJob) { String id = this.getNextJobID(); aJob.setJobID(id); aJob.setJobState(State.WAITING); jobsInProgress.add(aJob); return id; }
/** * Add a new job. * @param aJob the new job */ synchronized public String addJob(ControlledJob aJob) { String id = this.getNextJobID(); aJob.setJobID(id); aJob.setJobState(State.WAITING); this.addToQueue(aJob); return id; }
@Test public void testAddingDependingJobToRunningJobFails() throws Exception { Configuration conf = new Configuration(); ControlledJob job1 = new ControlledJob(conf); job1.setJobState(ControlledJob.State.RUNNING); assertFalse(job1.addDependingJob(new ControlledJob(conf))); }
@Test public void testAddingDependingJobToCompletedJobFails() throws Exception { Configuration conf = new Configuration(); ControlledJob job1 = new ControlledJob(conf); job1.setJobState(ControlledJob.State.SUCCESS); assertFalse(job1.addDependingJob(new ControlledJob(conf))); }
@Test public void testAddingDependingJobToCompletedJobFails() throws Exception { Configuration conf = new Configuration(); ControlledJob job1 = new ControlledJob(conf); job1.setJobState(ControlledJob.State.SUCCESS); assertFalse(job1.addDependingJob(new ControlledJob(conf))); }
@Test public void testAddingDependingJobToRunningJobFails() throws Exception { Configuration conf = new Configuration(); ControlledJob job1 = new ControlledJob(conf); job1.setJobState(ControlledJob.State.RUNNING); assertFalse(job1.addDependingJob(new ControlledJob(conf))); }