use of org.eclipse.n4js.tester.domain.TestTree in project n4js by eclipse.
the class HeadlessTestDiscoveryTest method testDiscoveryForSameExistingFile.
/**
*/
@Test
public void testDiscoveryForSameExistingFile() {
final TestTree actual = helper.collectTests(toURI(TEST_CLASS_FILE), toURI(TEST_CLASS_FILE));
assertTestSuiteCount(actual, 3);
String suiteA = createFqn(DEFAULT_PROJECT_OUTPUT, TEST_SRC_STRUCTURE, TEST_CLASS_1, "A");
String suiteB = createFqn(DEFAULT_PROJECT_OUTPUT, TEST_SRC_STRUCTURE, TEST_CLASS_1, "B");
String suiteC = createFqn(DEFAULT_PROJECT_OUTPUT, TEST_SRC_STRUCTURE, TEST_CLASS_1, "C");
assertTestSuiteNames(actual, suiteA, suiteB, suiteC);
assertTestCaseCount(actual, 4);
assertTestCaseCountForSuite(actual, suiteA, 2);
assertTestCaseCountForSuite(actual, suiteB, 1);
assertTestCaseCountForSuite(actual, suiteC, 1);
}
use of org.eclipse.n4js.tester.domain.TestTree in project n4js by eclipse.
the class HeadlessTestDiscoveryTest method testDiscoveryForSameExistingFile_WithExportFiltering.
/**
*/
@Test
public void testDiscoveryForSameExistingFile_WithExportFiltering() {
final TestTree actual = helper.collectTests(toURI(TEST_CLASS_FILE_IDEBUG_572), toURI(TEST_CLASS_FILE_IDEBUG_572));
assertTestSuiteCount(actual, 2);
String suiteC = createFqn(DEFAULT_PROJECT_OUTPUT, TEST_SRC_STRUCTURE, TEST_CLASS_2, "C");
String suiteF = createFqn(DEFAULT_PROJECT_OUTPUT, TEST_SRC_STRUCTURE, TEST_CLASS_2, "F");
assertTestSuiteNames(actual, suiteC, suiteF);
assertTestCaseCount(actual, 3);
assertTestCaseCountForSuite(actual, suiteC, 1);
assertTestCaseCountForSuite(actual, suiteF, 2);
}
use of org.eclipse.n4js.tester.domain.TestTree in project n4js by eclipse.
the class HeadlessTestDiscoveryTest method testDiscoveryForExistingProjectFolderAndFile_WithExportFiltering.
/**
*/
@Test
public void testDiscoveryForExistingProjectFolderAndFile_WithExportFiltering() {
final TestTree actual = helper.collectTests(toURI(TEST_PROJECT), toURI(TEST_SRC_FOLDER), toURI(TEST_CLASS_FILE));
assertTestSuiteCount(actual, 3);
String suiteA = createFqn(DEFAULT_PROJECT_OUTPUT, TEST_SRC_STRUCTURE, TEST_CLASS_1, "A");
String suieB = createFqn(DEFAULT_PROJECT_OUTPUT, TEST_SRC_STRUCTURE, TEST_CLASS_1, "B");
String suiteC = createFqn(DEFAULT_PROJECT_OUTPUT, TEST_SRC_STRUCTURE, TEST_CLASS_1, "C");
assertTestSuiteNames(actual, suiteA, suieB, suiteC);
assertTestCaseCount(actual, 4);
assertTestCaseCountForSuite(actual, suiteA, 2);
assertTestCaseCountForSuite(actual, suieB, 1);
assertTestCaseCountForSuite(actual, suiteC, 1);
}
use of org.eclipse.n4js.tester.domain.TestTree in project n4js by eclipse.
the class TesterDomainTest method testTestTreeClone.
/**
*/
@Test
public void testTestTreeClone() throws Exception {
final List<TestSuite> originalTestSuites = newArrayList();
final TestSuite originalTestSuite = new TestSuite("name");
final TestCase originalTestCase = new TestCase(new ID("testId"), "testId", "testId", "testId", "testId", URI.createURI("testURI_testId"));
originalTestSuite.add(originalTestCase);
originalTestSuites.add(originalTestSuite);
final TestTree originalTestTree = new TestTree(new ID("value"), originalTestSuites);
final TestTree copyTestTree = originalTestTree.clone();
assertEquals(originalTestTree, copyTestTree);
assertFalse(originalTestTree == copyTestTree);
assertFalse(originalTestSuites == copyTestTree.getSuites());
assertFalse(originalTestSuite == getOnlyElement(copyTestTree.getSuites()));
assertEquals(originalTestCase, getOnlyElement(getOnlyElement(copyTestTree.getSuites()).getTestCases()));
assertFalse(originalTestCase == getOnlyElement(getOnlyElement(copyTestTree.getSuites()).getTestCases()));
}
use of org.eclipse.n4js.tester.domain.TestTree 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