net.sourceforge.sqlunit.reporters
Class EmptyReporter

java.lang.Object
  extended by net.sourceforge.sqlunit.reporters.EmptyReporter
All Implemented Interfaces:
IReporter

public class EmptyReporter
extends java.lang.Object
implements IReporter

An empty reporter implementation. Useful for test cases.

Version:
$Revision: 1.1 $
Author:
Ivan Ivanov

Constructor Summary
EmptyReporter(java.lang.String filename)
           
 
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 config)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmptyReporter

public EmptyReporter(java.lang.String filename)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: IReporter
Returns a hardcoded name identifying the reporter implementation. This name is a key in the reporter.properties file.

Specified by:
getName in interface IReporter
Returns:
a unique hardcoded name for the reporter implementation.

hasContainer

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

Specified by:
hasContainer in interface IReporter
Returns:
true if the reporter has its own container, else false.

newTestFile

public void newTestFile(java.lang.String testName,
                        java.lang.String testFile)
Description copied from interface: IReporter
Called when a new sqlunit test file is run.

Specified by:
newTestFile in interface IReporter
Parameters:
testName - the name of the test being run
testFile - the filename of the test file

settingUpConnection

public void settingUpConnection(java.lang.String connectionId)
Description copied from interface: IReporter
Called before a database connection is setup.

Specified by:
settingUpConnection in interface IReporter
Parameters:
connectionId - the id of the connection being attempted, or null for the default connection

setConfig

public void setConfig(java.util.Map config)
Description copied from interface: IReporter
Called after the connection is made. The map contains key/value pairs of configuration parameters for the connection and debug settings.

Specified by:
setConfig in interface IReporter
Parameters:
config - the configuration map

setUp

public void setUp()
Description copied from interface: IReporter
Called before the set up section of the test.

Specified by:
setUp in interface IReporter

runningTest

public void runningTest(java.lang.String name,
                        int testIndex,
                        java.lang.String desc)
Description copied from interface: IReporter
Called before a test is run.

Specified by:
runningTest in interface IReporter
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

public void finishedTest(long elapsed,
                         boolean success)
Description copied from interface: IReporter
Called when a test is completed

Specified by:
finishedTest in interface IReporter
Parameters:
elapsed - the time in milliseconds the test took to run
success - true if the test succeeded, false otherwise

skippedTest

public void skippedTest(java.lang.String name,
                        int testIndex,
                        java.lang.String desc)
Description copied from interface: IReporter
Called when a test is skipped because of an earlier failure.

Specified by:
skippedTest in interface IReporter
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

public void addFailure(java.lang.Throwable th,
                       boolean error)
Description copied from interface: IReporter
Called when an exception occured during processing.

Specified by:
addFailure in interface IReporter
Parameters:
th - the exception that occured
error - true if the exception is an error, false if it is a failure

tearDown

public void tearDown()
Description copied from interface: IReporter
Called before the tear down section is run

Specified by:
tearDown in interface IReporter

tempFile

public void tempFile(int testId,
                     java.lang.String result,
                     java.lang.String file)
Description copied from interface: IReporter
Called when a test has failed and a temporary file is left containing data.

Specified by:
tempFile in interface IReporter
Parameters:
testId - the index of the test
result - the result of the test
file - the temporary file

testFileComplete

public void testFileComplete(boolean success)
Description copied from interface: IReporter
Called when the test file has been completed.

Specified by:
testFileComplete in interface IReporter
Parameters:
success - true if everything completed with no errors, false otherwise

echo

public void echo(java.lang.String message)
Description copied from interface: IReporter
Makes the reporter emit a predefined value.

Specified by:
echo in interface IReporter
Parameters:
message - the message to emit.