net.sourceforge.sqlunit
Interface IReporter

All Known Implementing Classes:
CanooWebTestReporter, EmptyReporter, ReporterList, TextReporter

public interface IReporter

The reporter interface that all reporters must implement.

Author:
Rob Nielsen (robn@asert.com.au)

Method Summary
 void addFailure(java.lang.Throwable th, boolean error)
          Called when an exception occured during processing.
 void echo(java.lang.String message)
          Makes the reporter emit a predefined value.
 void finishedTest(long elapsed, boolean success)
          Called when a test is completed
 java.lang.String getName()
          Returns a hardcoded name identifying the reporter implementation.
 boolean hasContainer()
          Returns true if the reporter has its own container.
 void newTestFile(java.lang.String testName, java.lang.String testFile)
          Called when a new sqlunit test file is run.
 void runningTest(java.lang.String name, int testIndex, java.lang.String desc)
          Called before a test is run.
 void setConfig(java.util.Map configMap)
          Called after the connection is made.
 void settingUpConnection(java.lang.String connectionId)
          Called before a database connection is setup.
 void setUp()
          Called before the set up section of the test.
 void skippedTest(java.lang.String name, int testIndex, java.lang.String desc)
          Called when a test is skipped because of an earlier failure.
 void tearDown()
          Called before the tear down section is run
 void tempFile(int testId, java.lang.String result, java.lang.String file)
          Called when a test has failed and a temporary file is left containing data.
 void testFileComplete(boolean success)
          Called when the test file has been completed.
 

Method Detail

getName

java.lang.String getName()
Returns a hardcoded name identifying the reporter implementation. This name is a key in the reporter.properties file.

Returns:
a unique hardcoded name for the reporter implementation.

hasContainer

boolean hasContainer()
Returns true if the reporter has its own container. If it does, then SQLUnit will not attempt to build a container for this.

Returns:
true if the reporter has its own container, else false.

newTestFile

void newTestFile(java.lang.String testName,
                 java.lang.String testFile)
Called when a new sqlunit test file is run.

Parameters:
testName - the name of the test being run
testFile - the filename of the test file

settingUpConnection

void settingUpConnection(java.lang.String connectionId)
Called before a database connection is setup.

Parameters:
connectionId - the id of the connection being attempted, or null for the default connection

setConfig

void setConfig(java.util.Map configMap)
Called after the connection is made. The map contains key/value pairs of configuration parameters for the connection and debug settings.

Parameters:
configMap - the configuration map

setUp

void setUp()
Called before the set up section of the test.


runningTest

void runningTest(java.lang.String name,
                 int testIndex,
                 java.lang.String desc)
Called before a test is run.

Parameters:
name - the name of the test being run
testIndex - the index of the test being run
desc - a description of the test being run

finishedTest

void finishedTest(long elapsed,
                  boolean success)
Called when a test is completed

Parameters:
elapsed - the time in milliseconds the test took to run
success - true if the test succeeded, false otherwise

skippedTest

void skippedTest(java.lang.String name,
                 int testIndex,
                 java.lang.String desc)
Called when a test is skipped because of an earlier failure.

Parameters:
name - the name of the test being run
testIndex - the index of the test being run
desc - a description of the test being run

addFailure

void addFailure(java.lang.Throwable th,
                boolean error)
Called when an exception occured during processing.

Parameters:
th - the exception that occured
error - true if the exception is an error, false if it is a failure

tearDown

void tearDown()
Called before the tear down section is run


tempFile

void tempFile(int testId,
              java.lang.String result,
              java.lang.String file)
Called when a test has failed and a temporary file is left containing data.

Parameters:
testId - the index of the test
result - the result of the test
file - the temporary file

testFileComplete

void testFileComplete(boolean success)
Called when the test file has been completed.

Parameters:
success - true if everything completed with no errors, false otherwise

echo

void echo(java.lang.String message)
Makes the reporter emit a predefined value.

Parameters:
message - the message to emit.