use of org.btrplace.model.Model in project scheduler by btrplace.
the class BanConverterTest method testViables.
@Test
public void testViables() throws JSONConverterException {
ConstraintsConverter conv = new ConstraintsConverter();
conv.register(new BanConverter());
Model mo = new DefaultModel();
Ban d = new Ban(mo.newVM(), Arrays.asList(mo.newNode(), mo.newNode()));
Assert.assertEquals(conv.fromJSON(mo, conv.toJSON(d)), d);
System.out.println(conv.toJSON(d));
}
use of org.btrplace.model.Model in project scheduler by btrplace.
the class FenceConverterTest method testViables.
@Test
public void testViables() throws JSONConverterException {
Model mo = new DefaultModel();
ConstraintsConverter conv = new ConstraintsConverter();
conv.register(new FenceConverter());
Fence d = new Fence(mo.newVM(), Arrays.asList(mo.newNode(), mo.newNode()));
Assert.assertEquals(conv.fromJSON(mo, conv.toJSON(d)), d);
System.out.println(conv.toJSON(d));
}
use of org.btrplace.model.Model 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.Model 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.Model 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));
}
Aggregations