Search in sources :

Example 11 with TestCase

use of org.eclipse.n4js.tester.domain.TestCase 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()));
}
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) Test(org.junit.Test)

Aggregations

TestCase (org.eclipse.n4js.tester.domain.TestCase)11 UUID.randomUUID (java.util.UUID.randomUUID)5 ID (org.eclipse.n4js.tester.domain.ID)5 TestSuite (org.eclipse.n4js.tester.domain.TestSuite)5 TestTree (org.eclipse.n4js.tester.domain.TestTree)4 ISelection (org.eclipse.jface.viewers.ISelection)2 TestElement (org.eclipse.n4js.tester.domain.TestElement)2 Function (com.google.common.base.Function)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 IFile (org.eclipse.core.resources.IFile)1 URI (org.eclipse.emf.common.util.URI)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 TestResult (org.eclipse.n4js.tester.domain.TestResult)1 TClass (org.eclipse.n4js.ts.types.TClass)1 TMethod (org.eclipse.n4js.ts.types.TMethod)1 IN4JSEclipseProject (org.eclipse.n4js.ui.projectModel.IN4JSEclipseProject)1 Test (org.junit.Test)1