use of org.btrplace.model.constraint.Constraint in project scheduler by btrplace.
the class MaxOnlineConverterTest method testViables.
@Test
public void testViables() throws JSONConverterException {
Model model = new DefaultModel();
Set<Node> s = new HashSet<>(Arrays.asList(model.newNode(), model.newNode(), model.newNode()));
MaxOnline mo = new MaxOnline(s, 2);
ConstraintsConverter conv = new ConstraintsConverter();
conv.register(new MaxOnlineConverter());
Constraint new_max = conv.fromJSON(model, conv.toJSON(mo));
Assert.assertEquals(mo, new_max);
System.out.println(conv.toJSON(mo));
}
Aggregations