Package fitnesse.testsystems

Examples of fitnesse.testsystems.TestSummary


  public void testSuiteTearDownSummaryWithTestResults() throws Exception {
    testSuiteMetaTestSummaryWithTestResults("SuiteTearDown");
  }

  private void testSuiteMetaTestSummaryWithoutTestResults(String pageName) throws Exception {
    formatter.processTestResults(pageName, new TestSummary(0, 0, 0, 0));
    formatter.finishWritingOutput();

    assertSubString("<span class=\\\"results pass\\\">0 right, 0 wrong, 0 ignored, 0 exceptions</span>", pageBuffer.toString());
    assertSubString("<strong>Test Pages:</strong> 1 right, 0 wrong, 0 ignored, 0 exceptions", pageBuffer.toString());
    assertSubString("<strong>Assertions:</strong> 0 right, 0 wrong, 0 ignored, 0 exceptions", pageBuffer.toString());
View Full Code Here


      long time = DateTimeUtil.getTimeFromString(XmlUtil.getTextValue(refElement,"date"));
      long runTimeInMillis = getRunTimeInMillisOrZeroIfNotPresent(refElement);
      PageHistoryReference r1 = new PageHistoryReference(name,time,runTimeInMillis);
      Element counts = XmlUtil.getElementByTagName(refElement,"counts");

      r1.setTestSummary(new TestSummary(
              Integer.valueOf(XmlUtil.getTextValue(counts, "right")),
              Integer.valueOf(XmlUtil.getTextValue(counts, "wrong")),
              Integer.valueOf(XmlUtil.getTextValue(counts, "ignores")),
              Integer.valueOf(XmlUtil.getTextValue(counts, "exceptions"))));
      pageHistoryReferences.add(r1);
View Full Code Here

    testSuiteMetaTestSummaryWithoutTestResults("SuiteTearDown");
  }

  @Test
  public void testCountsHtml() throws Exception {
    formatter.processTestResults("RelativePageName", new TestSummary(1, 0, 0, 0));

    assertSubString("<span class=\\\"results pass\\\">1 right, 0 wrong, 0 ignored, 0 exceptions</span>", pageBuffer.toString());
    assertSubString("<a href=\\\"#RelativePageName0\\\" class=\\\"link\\\">RelativePageName</a>", pageBuffer.toString());

    pageBuffer.setLength(0);
    formatter.processTestResults("AnotherPageName", new TestSummary(0, 1, 0, 0));

    assertSubString("<span class=\\\"results fail\\\">0 right, 1 wrong, 0 ignored, 0 exceptions</span>", pageBuffer.toString());
    assertSubString("<a href=\\\"#AnotherPageName0\\\" class=\\\"link\\\">AnotherPageName</a>", pageBuffer.toString());
  }
View Full Code Here

    formatter.testSystemStarted(fitMock);
    formatter.announceNumberTestsToRun(2);
    formatter.announceStartNewTest("RelativeName", "FullName");
    formatter.testOutputChunk("starting");
    formatter.testOutputChunk(" output");
    formatter.processTestResults("RelativeName", new TestSummary(1, 0, 0, 0));
    formatter.testSystemStarted(slimMock);
    formatter.announceStartNewTest("NewRelativeName", "NewFullName");
    formatter.testOutputChunk("second");
    formatter.testOutputChunk(" test");
    formatter.processTestResults("NewRelativeName", new TestSummary(0, 1, 0, 0));
    formatter.finishWritingOutput();

    String results = pageBuffer.toString();

    assertSubString("<h2>Test System: Slim:very.slim</h2>", results);
View Full Code Here

    assertSubString("<script>document.getElementById(\"test-summary\").innerHTML =" +
        " \"<div id=\\\"progressBar\\\" class=\\\"pass\\\" style=\\\"width:0.0%\\\">", pageBuffer.toString());
    assertSubString("Running&nbsp;tests&nbsp;...&nbsp;(1/20)", pageBuffer.toString());
    pageBuffer.setLength(0);

    formatter.processTestResults("RelativeName", new TestSummary(1, 0, 0, 0));
    formatter.announceStartNewTest("RelativeName", "FullName");

    assertSubString("<script>document.getElementById(\"test-summary\").innerHTML =" +
        " \"<div id=\\\"progressBar\\\" class=\\\"pass\\\" style=\\\"width:5.0%\\\">", pageBuffer.toString());
    assertSubString("(2/20)", pageBuffer.toString());
    pageBuffer.setLength(0);


    formatter.processTestResults("RelativeName", new TestSummary(1, 0, 0, 0));
    formatter.announceStartNewTest("RelativeName", "FullName");

    assertSubString("<script>document.getElementById(\"test-summary\").innerHTML =" +
        " \"<div id=\\\"progressBar\\\" class=\\\"pass\\\" style=\\\"width:10.0%\\\">", pageBuffer.toString());
    assertSubString("(3/20)", pageBuffer.toString());
View Full Code Here

  @Test
  public void testTotalTimingShouldAppearInSummary() throws Exception {
    formatter.announceNumberTestsToRun(1);
    WikiTestPage firstPage = new WikiTestPage(new WikiPageDummy("page1", "content", null), variableSource);
    formatter.testStarted(firstPage);
    formatter.testComplete(firstPage, new TestSummary(1, 2, 3, 4));
    clock.elapse(900);
    formatter.close();
    assertSubString("<strong>Assertions:</strong> 1 right, 2 wrong, 3 ignored, 4 exceptions (0" + getDecimalSeparator() + "900 seconds)", pageBuffer.toString());
  }
View Full Code Here

    formatter.announceNumberTestsToRun(2);
    WikiTestPage firstPage = new WikiTestPage(new WikiPageDummy("page1", "content", null), variableSource);
    WikiTestPage secondPage = new WikiTestPage(new WikiPageDummy("page2", "content", null), variableSource);
    formatter.testStarted(firstPage);
    clock.elapse(670);
    formatter.testComplete(firstPage, new TestSummary(1, 2, 3, 4));
    formatter.testStarted(secondPage);
    clock.elapse(890);
    formatter.testComplete(secondPage, new TestSummary(5, 6, 7, 8));
    formatter.close();
    assertHasRegexp("<li.*\\(page1\\).*<span.*>\\(0(" + getDecimalSeparatorForRegExp() + "){1}670 seconds\\)</span>.*</li>", pageBuffer.toString());
    assertHasRegexp("<li.*\\(page2\\).*<span.*>\\(0(" + getDecimalSeparatorForRegExp() + "){1}890 seconds\\)</span>.*</li>", pageBuffer.toString());
  }
View Full Code Here

    public TestSummary getTestSummary() {
      return testSummary;
    }

    public void setTestSummary(TestSummary testSummary) {
      this.testSummary = new TestSummary(testSummary);
    }
View Full Code Here

  }

  private void unpackFinalCounts(Element testResults) {
    Element counts = XmlUtil.getElementByTagName(testResults, "finalCounts");
    if (counts != null) {
      finalCounts = new TestSummary(
        Integer.parseInt(XmlUtil.getTextValue(counts, "right")),
        Integer.parseInt(XmlUtil.getTextValue(counts, "wrong")),
        Integer.parseInt(XmlUtil.getTextValue(counts, "ignores")),
        Integer.parseInt(XmlUtil.getTextValue(counts, "exceptions"))
      );
View Full Code Here

    assertEquals(date, pageHistory.getMinDate());
    assertEquals(date, pageHistory.getMaxDate());
    assertEquals(1, pageHistory.size());
    TestResultRecord testSummary = pageHistory.get(date);
    assertEquals(date, testSummary.getDate());
    assertEquals(new TestSummary(1, 2, 3, 4), testSummary);
  }
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.