Package fitnesse.testsystems

Examples of fitnesse.testsystems.TestSummary


    String results = runSuite();
    assertSubString("<content>", results);
  }

  private File expectedXmlResultsFile() {
    TestSummary counts = new TestSummary(3, 0, 0, 0);
    String resultsFileName = String.format("%s/SuitePage/20081205011900_%d_%d_%d_%d.xml",
      context.getTestHistoryDirectory(), counts.getRight(), counts.getWrong(), counts.getIgnores(), counts.getExceptions());
    File xmlResultsFile = new File(resultsFileName);
    return xmlResultsFile;
  }
View Full Code Here


    return xmlResultsFile;
  }

  @Test
  public void normalSuiteRunProducesIndivualTestHistoryFile() throws Exception {
    TestSummary counts = new TestSummary(1, 0, 0, 0);
    String resultsFileName = String.format("%s/SuitePage.SlimTest/20081205011900_%d_%d_%d_%d.xml",
      context.getTestHistoryDirectory(), counts.getRight(), counts.getWrong(), counts.getIgnores(), counts.getExceptions());
    File xmlResultsFile = new File(resultsFileName);

    if (xmlResultsFile.exists())
      xmlResultsFile.delete();
View Full Code Here

    @Override
    public void runTests(TestPage pageToTest) throws IOException, InterruptedException {

      testSystemListener.testStarted(pageToTest);
      testSystemListener.testOutputChunk("<pre>" + pageToTest.getHtml() + "</pre>");
      testSystemListener.testComplete(pageToTest, new TestSummary(1, 0, 0, 0));
    }
View Full Code Here

    JUnitRunNotifierResultsListener listener = new JUnitRunNotifierResultsListener(notifier, getClass());

    TestResult testResult = SlimTestResult.fail("Actual", "Expected");

    listener.testAssertionVerified(null, testResult);
    listener.testComplete(mockWikiTestPage(), new TestSummary(0, 1, 0, 0));

    ArgumentCaptor<Failure> argument = ArgumentCaptor.forClass(Failure.class);
    verify(notifier).fireTestFailure(argument.capture());
    Failure failure = argument.getValue();
View Full Code Here

    JUnitRunNotifierResultsListener listener = new JUnitRunNotifierResultsListener(notifier, getClass());

    TestResult testResult = SlimTestResult.error("Message", "Actual");

    listener.testAssertionVerified(null, testResult);
    listener.testComplete(mockWikiTestPage(), new TestSummary(0, 0, 0, 1));

    ArgumentCaptor<Failure> argument = ArgumentCaptor.forClass(Failure.class);
    verify(notifier).fireTestFailure(argument.capture());
    Failure failure = argument.getValue();
View Full Code Here

    verify(mockResultsRepository).open(nestedPageName);
  }

  @Test
  public void testComplete_closesResultRepositoryAndAddsToTotalTestSummary() throws Exception{
    jf.setTotalSummary(new TestSummary(1,2,3,4));
    jf.testComplete(buildNestedTestPage(), new TestSummary(5,6,7,8));
    assertEquals(new TestSummary(6,8,10,12),jf.getTotalSummary());
    verify(mockResultsRepository).close();
  }
View Full Code Here

    verify(mockResultsRepository).close();
  }

  @Test
  public void writeSummary_WritesSummaryOfTestExecutions() throws Exception{
    jf.testComplete(buildNestedTestPage(), new TestSummary(5,6,7,8));
    WikiPageDummy root = new WikiPageDummy("root", null, null);
    WikiPageDummy secondPage=new WikiPageDummy("SecondPage", null, root);
    jf.testComplete(new WikiTestPage(secondPage, variableSource), new TestSummary(11,12,13,14));
    jf.writeSummary("SummaryPageName");
    String expectedOutput = new StringBuffer()
            .append(JavaFormatter.TestResultsSummaryTable.SUMMARY_HEADER)
            .append(new JavaFormatter.TestResultsSummaryTableRow(nestedPageName, new TestSummary(5,6,7,8)).toString())
            .append(new JavaFormatter.TestResultsSummaryTableRow("SecondPage", new TestSummary(11,12,13,14)).toString())
            .append(JavaFormatter.TestResultsSummaryTable.SUMMARY_FOOTER)
            .toString();
    verify(mockResultsRepository).open("SummaryPageName");
    verify(mockResultsRepository, times(1)).write(expectedOutput);
  }
View Full Code Here

  @Test
  public void testComplete_clones_TestSummary_Objects() throws Exception{
    WikiPageDummy root = new WikiPageDummy("root", null, null);
    WikiPageDummy secondPage=new WikiPageDummy("SecondPage", null, root);

    TestSummary ts=new TestSummary(5,6,7,8);
    jf.testComplete(buildNestedTestPage(), ts);
    ts.add(ExecutionResult.PASS);
    ts.add(ExecutionResult.FAIL);
    ts.add(ExecutionResult.IGNORE);
    ts.add(ExecutionResult.ERROR);
    jf.testComplete(new WikiTestPage(secondPage, variableSource), ts);
    assertEquals(new TestSummary(5,6,7,8), jf.getTestSummary("ParentTest.ChildTest"));
  }
View Full Code Here

  @Test
  public void summaryRowFormatsTestOutputRows(){
    assertEquals("pass, no errors or exceptions",
            "<tr class=\"pass\"><td><a href=\"TestName.html\">TestName</a></td><td>5</td><td>0</td><td>0</td></tr>",
            new JavaFormatter.TestResultsSummaryTableRow("TestName", new TestSummary(5, 0, 0, 0)).toString());
    assertEquals("red, 1 error ",
        "<tr class=\"fail\"><td><a href=\"TestName.html\">TestName</a></td><td>5</td><td>1</td><td>0</td></tr>",
        new JavaFormatter.TestResultsSummaryTableRow("TestName", new TestSummary(5,1,0,0)).toString());
    assertEquals("error,exceptions",
            "<tr class=\"error\"><td><a href=\"TestName.html\">TestName</a></td><td>5</td><td>6</td><td>7</td></tr>",
            new JavaFormatter.TestResultsSummaryTableRow("TestName", new TestSummary(5, 6, 0, 7)).toString());
  }
View Full Code Here

  }

  @Test
  public void allTestingComplete_writesSummaryIfMainPageWasntExecuted() throws Exception{
    TimeMeasurement timeMeasurement = new TimeMeasurement().start();
    jf.testComplete(buildNestedTestPage(), new TestSummary(5,6,7,8));
    jf.close();
    verify(mockResultsRepository).open(suiteName);    
  }
View Full Code Here

TOP

Related Classes of fitnesse.testsystems.TestSummary

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.