コード例 #1
0
  /** Test run one Test successfully. */
  @Test
  public void testRunsSuccessfully() {
    TestProtocolService protocolService = new TestProtocolService();
    TestCase testCase = new TestCase();
    testCase.setName("TestCase1");
    protocolService.set(testCase, new TestResult());

    TestResult testResult = protocolService.get(testCase);

    assertNotNull(testResult);
    assertTrue(!testResult.isSuccessfully());
  }
コード例 #2
0
  /** Test was never run before. */
  @Test
  public void testNeverRuns() {

    TestResult testResult = new TestResult();
    testResult.setWrong(1);

    TestCase testCase = new TestCase();
    testCase.setName("TestCase3");

    testResult = new TestProtocolService().get(testCase);

    assertNull(testResult);
  }
コード例 #3
0
 /** 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));
 }
コード例 #4
0
 /** 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));
 }
コード例 #5
0
  /** Test run one Test not successfully. */
  @Test
  public void testRunsNotSuccessfully() {
    TestProtocolService protocolService = new TestProtocolService();
    TestResult testResult = new TestResult();
    testResult.setException(0);
    testResult.setIgnored(0);
    testResult.setRight(0);
    testResult.setWrong(1);

    TestCase testCase = new TestCase();
    testCase.setName("TestCase2");
    protocolService.set(testCase, testResult);

    testResult = protocolService.get(testCase);

    assertNotNull(testResult);
    assertFalse(testResult.isSuccessfully());
  }