use of org.btrplace.json.model.constraint.ConstraintsConverter in project scheduler by btrplace.
the class PrecedenceConverterTest method testViables.
@Test
public void testViables() throws JSONConverterException {
Model mo = new DefaultModel();
ConstraintsConverter conv = new ConstraintsConverter();
conv.register(new PrecedenceConverter());
Precedence d = new Precedence(mo.newVM(), mo.newVM());
Assert.assertEquals(conv.fromJSON(mo, conv.toJSON(d)), d);
System.out.println(conv.toJSON(d));
}
use of org.btrplace.json.model.constraint.ConstraintsConverter in project scheduler by btrplace.
the class SyncConverterTest method testViables.
@Test
public void testViables() throws JSONConverterException {
Model mo = new DefaultModel();
ConstraintsConverter conv = new ConstraintsConverter();
conv.register(new SyncConverter());
Sync sync = new Sync(mo.newVM(), mo.newVM());
Assert.assertEquals(conv.fromJSON(mo, conv.toJSON(sync)).toString(), sync.toString());
System.out.println(conv.toJSON(sync));
}
use of org.btrplace.json.model.constraint.ConstraintsConverter in project scheduler by btrplace.
the class DeadlineConverterTest method testViables.
@Test
public void testViables() throws JSONConverterException {
Model mo = new DefaultModel();
ConstraintsConverter conv = new ConstraintsConverter();
conv.register(new DeadlineConverter());
Deadline d = new Deadline(mo.newVM(), "+00:00:15");
Assert.assertEquals(conv.fromJSON(mo, conv.toJSON(d)), d);
System.out.println(conv.toJSON(d));
}
use of org.btrplace.json.model.constraint.ConstraintsConverter in project scheduler by btrplace.
the class SerializeConverterTest method testViables.
@Test
public void testViables() throws JSONConverterException {
Model mo = new DefaultModel();
ConstraintsConverter conv = new ConstraintsConverter();
conv.register(new SerializeConverter());
Serialize serial = new Serialize(mo.newVM(), mo.newVM());
Assert.assertEquals(conv.fromJSON(mo, conv.toJSON(serial)).toString(), serial.toString());
System.out.println(conv.toJSON(serial));
}
Aggregations