use of org.btrplace.safeplace.testing.verification.spec.Context in project scheduler by btrplace.
the class MinusTest method testCollections.
@Test
public void testCollections() {
Constant v1 = new Constant(Arrays.asList(1, 2), new SetType(IntType.getInstance()));
Constant v2 = new Constant(Arrays.asList(2, 5), new SetType(IntType.getInstance()));
Minus<?> p = new SetMinus(v1, v2);
Set<?> s = (Set<?>) p.eval(new Context());
Assert.assertEquals(s.size(), 1);
Assert.assertEquals(p.type(), new SetType(IntType.getInstance()));
}
use of org.btrplace.safeplace.testing.verification.spec.Context in project scheduler by btrplace.
the class PlusTest method testCollections.
@Test
public void testCollections() {
Constant v1 = new Constant(new HashSet<>(Arrays.asList(1, 2)), new SetType(IntType.getInstance()));
Constant v2 = new Constant(new HashSet<>(Arrays.asList(4, 5)), new SetType(IntType.getInstance()));
Plus<?> p = new SetPlus(v1, v2);
Set<?> s = (Set<?>) p.eval(new Context());
Assert.assertEquals(s.size(), 4);
Assert.assertEquals(p.type(), new SetType(IntType.getInstance()));
}
Aggregations