use of org.btrplace.model.constraint.Online in project scheduler by btrplace.
the class COnlineTest method testInstantiation.
@Test
public void testInstantiation() {
Model mo = new DefaultModel();
Node n1 = mo.newNode();
Online on = new Online(n1);
COnline con = new COnline(on);
Assert.assertEquals(con.toString(), on.toString());
}
use of org.btrplace.model.constraint.Online in project scheduler by btrplace.
the class COnlineTest method testSolvableProblem.
@Test
public void testSolvableProblem() throws SchedulerException {
Model mo = new DefaultModel();
Node n1 = mo.newNode();
mo.getMapping().off(n1);
ChocoScheduler cra = new DefaultChocoScheduler();
ReconfigurationPlan plan = cra.solve(mo, Collections.singleton(new Online(n1)));
Assert.assertNotNull(plan);
Model res = plan.getResult();
Assert.assertTrue(res.getMapping().isOnline(n1));
}
Aggregations