use of org.btrplace.scheduler.choco.transition.TransitionFactory in project scheduler by btrplace.
the class DefaultChocoSchedulerTest method testTransitionFactoryCustomisation.
/**
* Remove the ready->running transition so the solving process will fail
*
* @throws org.btrplace.scheduler.SchedulerException
*/
@Test
public void testTransitionFactoryCustomisation() throws SchedulerException {
ChocoScheduler cra = new DefaultChocoScheduler();
TransitionFactory tf = cra.getTransitionFactory();
VMTransitionBuilder b = tf.getBuilder(VMState.READY, VMState.RUNNING);
Assert.assertTrue(tf.remove(b));
Model mo = new DefaultModel();
VM v = mo.newVM();
mo.getMapping().addReadyVM(v);
Assert.assertNull(cra.solve(mo, Collections.singletonList(new Running(v))));
}
Aggregations