use of org.eclipse.n4js.tester.domain.TestTree in project n4js by eclipse.
the class HeadlessTestDiscoveryTest method testDiscoveryForSingleExistingFile.
/**
*/
@Test
public void testDiscoveryForSingleExistingFile() {
final TestTree actual = helper.collectTests(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 TestTreeTransformerTest method createTestTree.
private TestTree createTestTree(final Multimap<String, String> suiteToCasesMapping) {
checkArgument(!suiteToCasesMapping.isEmpty());
final TestTree tree = new TestTree(new ID(randomUUID().toString()));
final List<TestSuite> suites = newArrayList();
suiteToCasesMapping.asMap().entrySet().forEach(entry -> {
final TestSuite suite = new TestSuite(entry.getKey());
entry.getValue().forEach(testCaseName -> suite.add(new TestCase(new ID(testCaseName), "class.name." + suite.getName(), "project.origin." + suite.getName(), testCaseName, "display.name." + testCaseName, URI.createURI("testURI_" + testCaseName))));
suites.add(suite);
});
tree.getSuites().addAll(suites);
return tree;
}
use of org.eclipse.n4js.tester.domain.TestTree in project n4js by eclipse.
the class MockTest method testMock.
private void testMock(final boolean parallel, int testCaseCountFactor) {
final String sessionId = valueOf(randomUUID());
final TestTree testTree = createNewTestTree(sessionId, testCaseCountFactor);
actualPort = facade.prepareTestSession(testTree);
testMock(testTree, parallel);
}
use of org.eclipse.n4js.tester.domain.TestTree in project n4js by eclipse.
the class HeadlessTestDiscoveryTest method testDiscoveryForExistingProjectFolderAndFile.
/**
*/
@Test
public void testDiscoveryForExistingProjectFolderAndFile() {
final TestTree actual = helper.collectTests(toURI(TEST_PROJECT_IDEBUG_572), toURI(TEST_SRC_FOLDER_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 testDiscoveryN4JSXForSingleExistingProject.
/**
*/
@Test
public void testDiscoveryN4JSXForSingleExistingProject() {
final TestTree actual = helper.collectTests(toURI(TEST_N4JSX_PROJECT));
String suiteD = createFqn(DEFAULT_PROJECT_OUTPUT, TEST_SRC_STRUCTURE, TEST_N4JSX_CLASS_3, "D");
String suiteE = createFqn(DEFAULT_PROJECT_OUTPUT, TEST_SRC_STRUCTURE, TEST_N4JSX_CLASS_3, "E");
String suiteF = createFqn(DEFAULT_PROJECT_OUTPUT, TEST_SRC_STRUCTURE, TEST_N4JSX_CLASS_4, "F");
assertTestSuiteNames(actual, suiteD, suiteE, suiteF);
assertTestSuiteCount(actual, 3);
assertTestCaseCountForSuite(actual, suiteD, 2);
assertTestCaseCountForSuite(actual, suiteE, 2);
assertTestCaseCount(actual, 7);
}
Aggregations