use of org.btrplace.model.DefaultModel in project scheduler by btrplace.
the class BtrpNumberTest method testNonViableGeq.
@Test(expectedExceptions = { UnsupportedOperationException.class })
public void testNonViableGeq() {
BtrpNumber i = new BtrpNumber(5, BtrpNumber.Base.BASE_16);
Model mo = new DefaultModel();
BtrpElement j = new BtrpElement(BtrpOperand.Type.VM, "foo", mo.newVM());
i.remainder(j);
}
use of org.btrplace.model.DefaultModel in project scheduler by btrplace.
the class BtrpNumberTest method testNonViablePower.
@Test(expectedExceptions = { UnsupportedOperationException.class })
public void testNonViablePower() {
BtrpNumber i = new BtrpNumber(5, BtrpNumber.Base.BASE_16);
Model mo = new DefaultModel();
BtrpElement j = new BtrpElement(BtrpOperand.Type.VM, "foo", mo.newVM());
i.power(j);
}
use of org.btrplace.model.DefaultModel in project scheduler by btrplace.
the class BtrpSetTest method testNonViableDivCauseType.
@Test(expectedExceptions = { UnsupportedOperationException.class })
public void testNonViableDivCauseType() {
BtrpSet s = new BtrpSet(1, BtrpOperand.Type.NUMBER);
Model mo = new DefaultModel();
s.div(new BtrpElement(BtrpOperand.Type.VM, "V", mo.newVM()));
}
use of org.btrplace.model.DefaultModel in project scheduler by btrplace.
the class BtrpSetTest method testNonViableRemainderCauseType.
@Test(expectedExceptions = { UnsupportedOperationException.class })
public void testNonViableRemainderCauseType() {
BtrpSet s = new BtrpSet(1, BtrpOperand.Type.NUMBER);
Model mo = new DefaultModel();
s.remainder(new BtrpElement(BtrpOperand.Type.VM, "V", mo.newVM()));
}
use of org.btrplace.model.DefaultModel in project scheduler by btrplace.
the class DefaultTemplateFactoryTest method testTypingIssue.
/*@Test(dependsOnMethods = {"testInstantiation", "testRegister"})
public void testAccessibleWithStrict() throws ElementBuilderException {
Model mo = new DefaultModel();
DefaultTemplateFactory tplf = new DefaultTemplateFactory(new InMemoryNamingService(mo));
tplf.register(new MockVMTemplate("mock1"));
Script scr = new Script();
tplf.check(scr, "mock1", null, new HashMap<String, String>());
Assert.assertEquals(mo.getAttributes().get(el.getElement(), "template"), "mock1");
} */
/*@Test(dependsOnMethods = {"testInstantiation", "testRegister"}, expectedExceptions = {ElementBuilderException.class})
public void testInaccessibleWithStrict() throws ElementBuilderException {
DefaultTemplateFactory tplf = new DefaultTemplateFactory(new InMemoryNamingService(), new DefaultModel());
Script scr = new Script();
tplf.check(scr, "bar", , "foo", new HashMap<String, String>());
} */
/*@Test(dependsOnMethods = {"testInstantiation", "testRegister"})
public void testAccessibleWithoutStrict() throws ElementBuilderException {
Model mo = new DefaultModel();
DefaultTemplateFactory tplf = new DefaultTemplateFactory(new InMemoryNamingService(), mo);
tplf.register(new MockVMTemplate("mock1"));
Script scr = new Script();
tplf.check(scr, "mock1", null, new HashMap<String, String>());
Assert.assertEquals(mo.getAttributes().get(el.getElement(), "template"), "mock1");
} */
/*@Test(dependsOnMethods = {"testInstantiation", "testRegister"})
public void testInaccessibleWithoutStrict() throws ElementBuilderException {
Model mo = new DefaultModel();
DefaultTemplateFactory tplf = new DefaultTemplateFactory(new InMemoryNamingService(), mo);
Map<String, String> m = new HashMap<>();
m.put("migratable", null);
m.put("foo", "7.5");
m.put("bar", "1243");
m.put("template", "bar");
Script scr = new Script();
tplf.check(scr, "bar", null, m);
Assert.assertEquals(mo.getAttributes().get(el.getElement(), "template"), "bar");
Assert.assertEquals(el.getName(), "foo");
Assert.assertTrue(mo.getAttributes().getBoolean(el.getElement(), "migratable"));
Assert.assertEquals(mo.getAttributes().getInteger(el.getElement(), "bar").longValue(), 1243);
Assert.assertEquals(mo.getAttributes().getDouble(el.getElement(), "foo"), 7.5);
Assert.assertEquals(mo.getAttributes().getKeys(el.getElement()), m.keySet());
} */
@Test(expectedExceptions = { ElementBuilderException.class })
public void testTypingIssue() throws ElementBuilderException {
Model mo = new DefaultModel();
DefaultTemplateFactory tplf = new DefaultTemplateFactory(NamingService.newNodeNS(), NamingService.newVMNS(), mo);
tplf.register(new MockVMTemplate("mock1"));
Script scr = new Script();
tplf.check(scr, "mock1", mo.newNode(), new HashMap<>());
}
Aggregations