use of org.btrplace.model.Model 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.Model 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));
}
use of org.btrplace.model.Model in project scheduler by btrplace.
the class QuarantineConverterTest method testViables.
@Test
public void testViables() throws JSONConverterException {
Model mo = new DefaultModel();
ConstraintsConverter conv = new ConstraintsConverter();
conv.register(new QuarantineConverter());
Quarantine d = new Quarantine(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 ResourceCapacityConverterTest method testViables.
@Test
public void testViables() throws JSONConverterException {
ConstraintsConverter conv = new ConstraintsConverter();
conv.register(new ResourceCapacityConverter());
Model mo = new DefaultModel();
ResourceCapacity d = new ResourceCapacity(new HashSet<>(Arrays.asList(mo.newNode(), mo.newNode(), mo.newNode())), "cpu", 5, false);
ResourceCapacity c = new ResourceCapacity(new HashSet<>(Arrays.asList(mo.newNode(), mo.newNode())), "mem", 5, 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 RunningCapacityConverterTest method testViables.
@Test
public void testViables() throws JSONConverterException {
ConstraintsConverter conv = new ConstraintsConverter();
conv.register(new RunningCapacityConverter());
Model mo = new DefaultModel();
RunningCapacity d = new RunningCapacity(new HashSet<>(Arrays.asList(mo.newNode(), mo.newNode(), mo.newNode())), 5, false);
RunningCapacity c = new RunningCapacity(new HashSet<>(Arrays.asList(mo.newNode(), mo.newNode())), 5, 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));
}
Aggregations