Skip to content

Commit

Permalink
Change of TestTextFormatter to make duration more visible
Browse files Browse the repository at this point in the history
Slight change of the output of the TestTextFormatter. The duration has
been put at the beginning to find easier long running test which might
indicate a problem.
  • Loading branch information
six42 committed Mar 31, 2015
1 parent 937e0c2 commit de35b5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/fitnesse/reporting/TestTextFormatter.java
Expand Up @@ -24,7 +24,8 @@ public TestTextFormatter(ChunkedResponse response) {

@Override
public void testSystemStarted(TestSystem testSystem) {
response.add(String.format("\nStarting Test System: %s.\n", testSystem.getName()));
String timeString = new SimpleDateFormat("yyyy-mm-dd HH:mm:ss").format(totalTimeMeasurement.startedAtDate());
response.add(String.format("\nStarting Test System at %s: %s.\n", timeString, testSystem.getName()));
}

@Override
Expand All @@ -40,9 +41,8 @@ public void testOutputChunk(String output) {
public void testComplete(WikiTestPage page, TestSummary summary) throws IOException {
timeMeasurement.stop();
updateCounters(summary);
String timeString = new SimpleDateFormat("HH:mm:ss").format(timeMeasurement.startedAtDate());
response.add(String.format("%s %s R:%-4d W:%-4d I:%-4d E:%-4d %s\t(%s)\t%.03f seconds\n",
passFail(summary), timeString, summary.getRight(), summary.getWrong(), summary.getIgnores(), summary.getExceptions(), page.getName(), page.getFullPath(), timeMeasurement.elapsedSeconds()));
response.add(String.format("%s %.03f sec R:%-4d W:%-4d I:%-4d E:%-4d %s\t(%s)\n",
passFail(summary), timeMeasurement.elapsedSeconds(), summary.getRight(), summary.getWrong(), summary.getIgnores(), summary.getExceptions(), page.getName(), page.getFullPath() ));
}

private void updateCounters(TestSummary summary) {
Expand Down
2 changes: 1 addition & 1 deletion test/fitnesse/reporting/TestTextFormatterTest.java
Expand Up @@ -46,7 +46,7 @@ public void testCompleteShouldAddPageAndSummaryAndTimingToResponse() throws Exce
clock.elapse(9800);
formatter.testComplete(page, summary);
formatter.close();
verify(response).add("F " + START_TIME + " R:1 W:2 I:3 E:4 page\t()\t9" + getDecimalSeparator() + "800 seconds\n");
verify(response).add("F 9" + getDecimalSeparator() + "800 sec R:1 W:2 I:3 E:4 page\t()\n");
}

@Test
Expand Down

0 comments on commit de35b5c

Please sign in to comment.