Search in sources :

Example 1 with TestTree

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

Example 2 with TestTree

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

Example 3 with TestTree

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);
}
Also used : TestTree(org.eclipse.n4js.tester.domain.TestTree)

Example 4 with TestTree

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

Example 5 with TestTree

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

Aggregations

TestTree (org.eclipse.n4js.tester.domain.TestTree)25 Test (org.junit.Test)14 UUID.randomUUID (java.util.UUID.randomUUID)7 ID (org.eclipse.n4js.tester.domain.ID)7 TestSuite (org.eclipse.n4js.tester.domain.TestSuite)7 TestCase (org.eclipse.n4js.tester.domain.TestCase)4 Function (com.google.common.base.Function)1 IOException (java.io.IOException)1 ExecutorService (java.util.concurrent.ExecutorService)1 URI (org.eclipse.emf.common.util.URI)1 ExitCodeException (org.eclipse.n4js.hlc.base.ExitCodeException)1 TestConfiguration (org.eclipse.n4js.tester.TestConfiguration)1 ITesterDescriptor (org.eclipse.n4js.tester.extension.ITesterDescriptor)1 TesterActivator (org.eclipse.n4js.tester.internal.TesterActivator)1 TModule (org.eclipse.n4js.ts.types.TModule)1