Search in sources :

Example 11 with ID

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())));
}
Also used : TestSuite(org.eclipse.n4js.tester.domain.TestSuite) ID(org.eclipse.n4js.tester.domain.ID) UUID.randomUUID(java.util.UUID.randomUUID) TestTree(org.eclipse.n4js.tester.domain.TestTree) Test(org.junit.Test)

Aggregations

ID (org.eclipse.n4js.tester.domain.ID)11 UUID.randomUUID (java.util.UUID.randomUUID)9 TestSuite (org.eclipse.n4js.tester.domain.TestSuite)7 TestTree (org.eclipse.n4js.tester.domain.TestTree)7 TestCase (org.eclipse.n4js.tester.domain.TestCase)5 Test (org.junit.Test)4 Function (com.google.common.base.Function)1 URI (org.eclipse.emf.common.util.URI)1 SessionEndedEvent (org.eclipse.n4js.tester.events.SessionEndedEvent)1 SessionFailedEvent (org.eclipse.n4js.tester.events.SessionFailedEvent)1 SessionFinishedEvent (org.eclipse.n4js.tester.events.SessionFinishedEvent)1 SessionStartedEvent (org.eclipse.n4js.tester.events.SessionStartedEvent)1 TestEndedEvent (org.eclipse.n4js.tester.events.TestEndedEvent)1 TestStartedEvent (org.eclipse.n4js.tester.events.TestStartedEvent)1 TModule (org.eclipse.n4js.ts.types.TModule)1