use of org.btrplace.model.DefaultModel in project scheduler by btrplace.
the class GatherConverterTest method testViables.
@Test
public void testViables() throws JSONConverterException {
Model mo = new DefaultModel();
ConstraintsConverter conv = new ConstraintsConverter();
conv.register(new GatherConverter());
Gather d = new Gather(Arrays.asList(mo.newVM(), mo.newVM()), false);
Gather c = new Gather(Arrays.asList(mo.newVM(), mo.newVM()), true);
Assert.assertEquals(conv.fromJSON(mo, conv.toJSON(d)), d);
Assert.assertEquals(conv.fromJSON(mo, conv.toJSON(c)), c);
System.out.println(conv.toJSON(d));
}
use of org.btrplace.model.DefaultModel in project scheduler by btrplace.
the class MinMigrationsConverterTest method test.
@Test
public void test() throws JSONConverterException {
Model mo = new DefaultModel();
ConstraintsConverter conv = new ConstraintsConverter();
conv.register(new MinMigrationsConverter());
MinMigrations m = new MinMigrations();
Assert.assertEquals(conv.fromJSON(mo, conv.toJSON(m)), m);
System.out.println(conv.toJSON(m));
}
use of org.btrplace.model.DefaultModel in project scheduler by btrplace.
the class MinMttrConverterTest method test.
@Test
public void test() throws JSONConverterException {
Model mo = new DefaultModel();
ConstraintsConverter conv = new ConstraintsConverter();
conv.register(new MinMTTRConverter());
MinMTTR m = new MinMTTR();
Assert.assertEquals(conv.fromJSON(mo, conv.toJSON(m)), m);
System.out.println(conv.toJSON(m));
}
use of org.btrplace.model.DefaultModel in project scheduler by btrplace.
the class OfflineConverterTest method testViables.
@Test
public void testViables() throws JSONConverterException {
Model mo = new DefaultModel();
ConstraintsConverter conv = new ConstraintsConverter();
conv.register(new OfflineConverter());
Offline d = new Offline(mo.newNode());
Assert.assertEquals(conv.fromJSON(mo, conv.toJSON(d)), d);
System.out.println(conv.toJSON(d));
}
use of org.btrplace.model.DefaultModel in project scheduler by btrplace.
the class OnlineConverterTest method testViables.
@Test
public void testViables() throws JSONConverterException {
Model mo = new DefaultModel();
ConstraintsConverter conv = new ConstraintsConverter();
conv.register(new OnlineConverter());
Online d = new Online(mo.newNode());
Assert.assertEquals(conv.fromJSON(mo, conv.toJSON(d)), d);
System.out.println(conv.toJSON(d));
}
Aggregations