/** Test Protocol on execute a TestSuite that contains referred Testcases. */
 @Test
 public void testRunSuiteWithReferedTestCases() {
   TestProtocolService protocolService = new TestProtocolService();
   TestResult testResult = new TestResult();
   TestResult tcTestResult = new TestResult();
   tcTestResult.setFullName("MyName");
   testResult.add(tcTestResult);
   TestSuite testSuite = new TestSuite();
   protocolService.set(testSuite, testResult);
   assertNotNull(protocolService.get(testSuite));
   TestCase testCase = new TestCase();
   testCase.setName("MyName");
   testSuite.addReferredTestStructure(testCase);
   assertNotNull(protocolService.get(testCase));
 }
 /** Test Protocol on execute a TestSuite that has Children. */
 @Test
 public void testRunSuiteWithChildren() {
   TestProtocolService protocolService = new TestProtocolService();
   TestCase testCase = new TestCase();
   testCase.setName("MyName");
   TestSuite testSuite = new TestSuite();
   testSuite.addChild(testCase);
   TestResult testResult = new TestResult();
   TestResult tcTestResult = new TestResult();
   tcTestResult.setFullName(testCase.getFullName());
   testResult.add(tcTestResult);
   assertTrue(testResult.isSuite());
   protocolService.set(testSuite, testResult);
   assertNotNull(protocolService.get(testSuite));
   assertNotNull(protocolService.get(testCase));
 }
Ejemplo n.º 3
0
 /**
  * Tests the lookup of a TestStructure based on a relative path name. Path Name like:
  * /DemoWebRapTests/DialogWidgetsSuite/ConfirmMessageTest
  *
  * @throws SystemException for test
  */
 @Test
 public void testLookUpOfTestStructure() throws SystemException {
   TestProject project = new TestProject();
   project.setName("DemoWebRapTests");
   TestSuite suite = new TestSuite();
   project.addChild(suite);
   suite.setName("DialogWidgetsSuite");
   TestCase testCase = new TestCase();
   testCase.setName("ConfirmMessageTest");
   suite.addChild(testCase);
   TeamChange change =
       new TeamChange(
           TeamChangeType.DELETE,
           "DemoWebRapTests.DialogWidgetsSuite.ConfirmMessageTest",
           project);
   TestStructure testStructure = change.getReleatedTestStructure();
   assertNotNull("TestStructure expected.", testStructure);
   assertEquals(
       "Expecting MyTestCase as teststructure", "ConfirmMessageTest", testStructure.getName());
 }