use of org.btrplace.model.DefaultModel in project scheduler by btrplace.
the class SplitAmongBuilderTest method testGoodSignatures.
@Test(dataProvider = "goodSplitAmongs")
public void testGoodSignatures(String str, int nbVGrp, int nbVMs, int nbPGrp, int nbNodes) throws Exception {
ScriptBuilder b = new ScriptBuilder(new DefaultModel());
SplitAmong x = (SplitAmong) b.build("namespace test; VM[1..10] : tiny;\n@N[1..20] : defaultNode;\n" + str).getConstraints().iterator().next();
Assert.assertEquals(x.getGroupsOfVMs().size(), nbVGrp);
Assert.assertEquals(x.getInvolvedVMs().size(), nbVMs);
Assert.assertEquals(x.getGroupsOfNodes().size(), nbPGrp);
Assert.assertEquals(x.getInvolvedNodes().size(), nbNodes);
Assert.assertEquals(x.isContinuous(), !str.startsWith(">>"));
}
use of org.btrplace.model.DefaultModel in project scheduler by btrplace.
the class SpreadBuilderTest method testGoodSignatures.
@Test(dataProvider = "goodSpreads")
public void testGoodSignatures(String str, int nbVMs) throws Exception {
ScriptBuilder b = new ScriptBuilder(new DefaultModel());
Spread x = (Spread) b.build("namespace test; VM[1..10] : tiny;\n" + str).getConstraints().iterator().next();
Assert.assertEquals(x.getInvolvedVMs().size(), nbVMs);
Assert.assertEquals(x.isContinuous(), !str.startsWith(">>"));
}
use of org.btrplace.model.DefaultModel in project scheduler by btrplace.
the class BtrpNumberTest method testNonViableGt.
@Test(expectedExceptions = { UnsupportedOperationException.class })
public void testNonViableGt() {
BtrpNumber i = new BtrpNumber(5, BtrpNumber.Base.BASE_16);
Model mo = new DefaultModel();
BtrpElement j = new BtrpElement(BtrpOperand.Type.VM, "foo", mo.newVM());
i.gt(j);
}
use of org.btrplace.model.DefaultModel in project scheduler by btrplace.
the class BtrpNumberTest method testNonViableDiv.
@Test(expectedExceptions = { UnsupportedOperationException.class })
public void testNonViableDiv() {
BtrpNumber i = new BtrpNumber(5, BtrpNumber.Base.BASE_16);
Model mo = new DefaultModel();
BtrpElement j = new BtrpElement(BtrpOperand.Type.VM, "foo", mo.newVM());
i.div(j);
}
use of org.btrplace.model.DefaultModel in project scheduler by btrplace.
the class BtrpNumberTest method testNonViableAddition.
@Test(expectedExceptions = { UnsupportedOperationException.class })
public void testNonViableAddition() {
BtrpNumber i = new BtrpNumber(5, BtrpNumber.Base.BASE_16);
Model mo = new DefaultModel();
BtrpElement j = new BtrpElement(BtrpOperand.Type.VM, "foo", mo.newVM());
i.plus(j);
}
Aggregations