use of org.eclipse.n4js.tester.domain.TestTree in project n4js by eclipse.
the class TestTreeRegistryTest method testRegisterTestTreeThenLookupAndAssertWithOriginal.
/**
*/
@Test
public void testRegisterTestTreeThenLookupAndAssertWithOriginal() {
final String sessionId = valueOf(randomUUID());
fsmRegistry.registerFsm(sessionId);
final TestTree original = newTestTree(sessionId);
treeRegistry.registerTestTree(original);
final TestTree copy = treeRegistry.getTestTree(sessionId);
assertNotNull(copy);
assertEquals(original, copy);
assertFalse(copy == original);
}
use of org.eclipse.n4js.tester.domain.TestTree in project n4js by eclipse.
the class TestTreeRegistryTest method newTestTree.
private TestTree newTestTree(final String sessionId, final String... testIds) {
final List<TestSuite> testSuites = newArrayList(transform(newHashSet(testIds), new Function<String, TestSuite>() {
@Override
public TestSuite apply(String testId) {
final TestSuite suite = new TestSuite("TestSuite_for_Test_" + testId);
final TestCase testCase = new TestCase(new ID(testId), "testClassName_" + testId, "origin_" + testId + "name_" + testId + "_0.0.0", "name_" + testId, "displayName_" + testId, URI.createURI("testURI_" + testId));
suite.setTestCases(singletonList(testCase));
return suite;
}
}));
return new TestTree(new ID(sessionId), testSuites);
}
use of org.eclipse.n4js.tester.domain.TestTree in project n4js by eclipse.
the class HeadlessTestDiscoveryTest method testDiscoveryForExistingProjectAndItsContainmentFile_WithExportFiltering.
/**
*/
@Test
public void testDiscoveryForExistingProjectAndItsContainmentFile_WithExportFiltering() {
final TestTree actual = helper.collectTests(toURI(TEST_PROJECT_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 testDiscoveryForExistingProjectAndItsContainmentFile.
/**
*/
@Test
public void testDiscoveryForExistingProjectAndItsContainmentFile() {
final TestTree actual = helper.collectTests(toURI(TEST_PROJECT), 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 testDiscoveryForSingleExistingProject.
/**
*/
@Test
public void testDiscoveryForSingleExistingProject() {
final TestTree actual = helper.collectTests(toURI(TEST_PROJECT));
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);
}
Aggregations