Browse Source

javadoc

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277286 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 21 years ago
parent
commit
9be317df59
1 changed files with 23 additions and 0 deletions
  1. +23
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/junit/BriefJUnitResultFormatter.java

+ 23
- 0
src/main/org/apache/tools/ant/taskdefs/optional/junit/BriefJUnitResultFormatter.java View File

@@ -69,6 +69,9 @@ public class BriefJUnitResultFormatter implements JUnitResultFormatter {
*/ */
private String systemError = null; private String systemError = null;


/**
* Constructor for BriefJUnitResultFormatter.
*/
public BriefJUnitResultFormatter() { public BriefJUnitResultFormatter() {
results = new StringWriter(); results = new StringWriter();
resultWriter = new PrintWriter(results); resultWriter = new PrintWriter(results);
@@ -76,16 +79,23 @@ public class BriefJUnitResultFormatter implements JUnitResultFormatter {


/** /**
* Sets the stream the formatter is supposed to write its results to. * Sets the stream the formatter is supposed to write its results to.
* @param out the output stream to write to
*/ */
public void setOutput(OutputStream out) { public void setOutput(OutputStream out) {
this.out = out; this.out = out;
output = new PrintWriter(out); output = new PrintWriter(out);
} }


/**
* @see JUnitResultFormatter#setSystemOutput(String)
*/
public void setSystemOutput(String out) { public void setSystemOutput(String out) {
systemOutput = out; systemOutput = out;
} }


/**
* @see JUnitResultFormatter#setSystemError(String)
*/
public void setSystemError(String err) { public void setSystemError(String err) {
systemError = err; systemError = err;
} }
@@ -162,12 +172,14 @@ public class BriefJUnitResultFormatter implements JUnitResultFormatter {


/** /**
* A test started. * A test started.
* @param test a test
*/ */
public void startTest(Test test) { public void startTest(Test test) {
} }


/** /**
* A test ended. * A test ended.
* @param test a test
*/ */
public void endTest(Test test) { public void endTest(Test test) {
} }
@@ -176,6 +188,8 @@ public class BriefJUnitResultFormatter implements JUnitResultFormatter {
* Interface TestListener for JUnit <= 3.4. * Interface TestListener for JUnit <= 3.4.
* *
* <p>A Test failed. * <p>A Test failed.
* @param test a test
* @param t the exception thrown by the test
*/ */
public void addFailure(Test test, Throwable t) { public void addFailure(Test test, Throwable t) {
formatError("\tFAILED", test, t); formatError("\tFAILED", test, t);
@@ -185,6 +199,8 @@ public class BriefJUnitResultFormatter implements JUnitResultFormatter {
* Interface TestListener for JUnit &gt; 3.4. * Interface TestListener for JUnit &gt; 3.4.
* *
* <p>A Test failed. * <p>A Test failed.
* @param test a test
* @param t the assertion failed by the test
*/ */
public void addFailure(Test test, AssertionFailedError t) { public void addFailure(Test test, AssertionFailedError t) {
addFailure(test, (Throwable) t); addFailure(test, (Throwable) t);
@@ -192,6 +208,8 @@ public class BriefJUnitResultFormatter implements JUnitResultFormatter {


/** /**
* A test caused an error. * A test caused an error.
* @param test a test
* @param error the error thrown by the test
*/ */
public void addError(Test test, Throwable error) { public void addError(Test test, Throwable error) {
formatError("\tCaused an ERROR", test, error); formatError("\tCaused an ERROR", test, error);
@@ -199,6 +217,8 @@ public class BriefJUnitResultFormatter implements JUnitResultFormatter {


/** /**
* Format the test for printing.. * Format the test for printing..
* @param test a test
* @return the formatted testname
*/ */
protected String formatTest(Test test) { protected String formatTest(Test test) {
if (test == null) { if (test == null) {
@@ -210,6 +230,9 @@ public class BriefJUnitResultFormatter implements JUnitResultFormatter {


/** /**
* Format an error and print it. * Format an error and print it.
* @param type the type of error
* @param test the test that failed
* @param error the exception that the test threw
*/ */
protected synchronized void formatError(String type, Test test, protected synchronized void formatError(String type, Test test,
Throwable error) { Throwable error) {


Loading…
Cancel
Save