Skip to content

Commit

Permalink
Remove e.printStackTrace from fitnesse.reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
amolenaar committed Sep 21, 2013
1 parent 3134cf6 commit 44bd6b4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 5 additions & 2 deletions src/fitnesse/reporting/BaseFormatter.java
Expand Up @@ -13,8 +13,11 @@

import java.io.Closeable;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

public abstract class BaseFormatter implements TestSystemListener<WikiTestPage>, Closeable {
protected static final Logger LOG = Logger.getLogger("Report");

protected WikiPage page = null;
protected FitNesseContext context;
Expand All @@ -41,8 +44,8 @@ protected WikiPage getPage() {
public void errorOccurred(Throwable cause) {
try {
close();
} catch (Exception e) {
e.printStackTrace();
} catch (IOException e) {
LOG.log(Level.WARNING, "Unable to close formatter after error occurred", e);
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/fitnesse/reporting/XmlFormatter.java
Expand Up @@ -24,6 +24,7 @@
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;

public class XmlFormatter extends BaseFormatter {
public interface WriterFactory {
Expand Down Expand Up @@ -89,7 +90,7 @@ public void testAssertionVerified(Assertion assertion, TestResult testResult) {
expectationResult.row = Integer.toString(cell.getRow());
}
} catch (Throwable e) {
e.printStackTrace();
LOG.log(Level.WARNING, "Unable to process assertion " + assertion + " with test result " + testResult, e);
}
}

Expand All @@ -111,7 +112,7 @@ public void testExceptionOccurred(Assertion assertion, ExceptionResult exception
expectationResult.evaluationMessage = exceptionResult.getMessage();
expectationResult.status = exceptionResult.getExecutionResult().toString();
} catch (Throwable e) {
e.printStackTrace();
LOG.log(Level.WARNING, "Unable to process assertion " + assertion + " with exception result " + exceptionResult, e);
}
}

Expand Down
Expand Up @@ -2,10 +2,13 @@

import java.io.File;
import java.text.ParseException;
import java.util.logging.Level;
import java.util.logging.Logger;

import fitnesse.reporting.TestResultRecord;

public class MostRecentPageHistoryReader extends PageHistoryReader {
private final static Logger LOG = Logger.getLogger("Report");

TestResultRecord mostRecentRecord = null;
File directory = null;
Expand All @@ -18,8 +21,7 @@ public TestResultRecord findMostRecentTestRun() {
try {
readHistoryFromPageDirectory(directory);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
LOG.log(Level.WARNING, "Unable to read history from page directory", e);
}
return mostRecentRecord;
}
Expand Down

0 comments on commit 44bd6b4

Please sign in to comment.