use of org.eclipse.n4js.tester.domain.ID in project n4js by eclipse.
the class TesterDomainTest method testTestTreeIterator.
/**
*/
@Test
public void testTestTreeIterator() {
final TestTree tree = new TestTree(new ID(valueOf(randomUUID())));
final TestSuite a = new TestSuite("A");
a.addAll(newTestCase("1", "2", "3"));
final TestSuite b = new TestSuite("B");
b.addAll(newTestCase("4", "5", "6"));
final TestSuite a1 = new TestSuite("A.1");
a1.addAll(newTestCase("7", "8"));
final TestSuite a2 = new TestSuite("A.2");
a2.addAll(newTestCase("9", "10"));
final TestSuite a11 = new TestSuite("A.1.1");
a11.addAll(newTestCase("11", "12"));
a1.getChildren().add(a11);
a.getChildren().add(a1);
a.getChildren().add(a2);
tree.getSuites().add(a);
tree.getSuites().add(b);
assertEquals(4, size(a1));
assertEquals(newHashSet("7", "8", "11", "12"), newHashSet(transform(a1, testCase -> testCase.getId().getValue())));
assertEquals(9, size(a));
assertEquals(newHashSet("1", "2", "3", "7", "8", "9", "10", "11", "12"), newHashSet(transform(a, testCase -> testCase.getId().getValue())));
assertEquals(12, size(tree));
assertEquals(newHashSet("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"), newHashSet(transform(tree, testCase -> testCase.getId().getValue())));
}
Aggregations