net.sourceforge.sqlunit.reporters
Class CanooWebTestReporter

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

public class CanooWebTestReporter
extends java.lang.Object
implements IReporter

SQLUnit Reporter that works with the Canoo Web Test framework. Generates XML that can be converted to output for the Canoo Web Test console.

Version:
$Revision: 1.9 $
Author:
Rob Nielsen (robn@asert.com.au), Paul King (paulk@asert.com.au)

Field Summary
static java.lang.String FORMAT_NAME
          the format name to be used in the ant task
 
Constructor Summary
CanooWebTestReporter(java.lang.String outputFile)
          Constructs a new CanooWebTestReporter
 
Method Summary
 void addFailure(java.lang.Throwable th, boolean isError)
          Called when an exception occured during processing.
 void echo(java.lang.String message)
          Called from within the test from the SQLUnit Echo tag to print out values from within the test.
 void finishedTest(long time, boolean success)
          Called when a test is completed
 java.lang.String getName()
          Returns the format name.
 boolean hasContainer()
          Returns true since this reporter runs in the context of a Canoo Web Test.
 void newTestFile(java.lang.String name, java.lang.String location)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORMAT_NAME

public static final java.lang.String FORMAT_NAME
the format name to be used in the ant task

See Also:
Constant Field Values
Constructor Detail

CanooWebTestReporter

public CanooWebTestReporter(java.lang.String outputFile)
                     throws java.lang.Exception
Constructs a new CanooWebTestReporter

Parameters:
outputFile - the file
Throws:
java.lang.Exception - if a problem occurs
Method Detail

getName

public final java.lang.String getName()
Returns the format name.

Specified by:
getName in interface IReporter
Returns:
the format name.

hasContainer

public final boolean hasContainer()
Returns true since this reporter runs in the context of a Canoo Web Test.

Specified by:
hasContainer in interface IReporter
Returns:
true.

newTestFile

public final void newTestFile(java.lang.String name,
                              java.lang.String location)
Called when a new sqlunit test file is run.

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

settingUpConnection

public final void settingUpConnection(java.lang.String connectionId)
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 final 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.

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

setUp

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

Specified by:
setUp in interface IReporter

runningTest

public final void runningTest(java.lang.String name,
                              int testIndex,
                              java.lang.String desc)
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 final void finishedTest(long time,
                               boolean success)
Called when a test is completed

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

skippedTest

public final void skippedTest(java.lang.String name,
                              int testIndex,
                              java.lang.String desc)
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 final void addFailure(java.lang.Throwable th,
                             boolean isError)
Called when an exception occured during processing.

Specified by:
addFailure in interface IReporter
Parameters:
th - the exception that occured
isError - true if the exception is an error, else false.

tempFile

public final 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.

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

tearDown

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

Specified by:
tearDown in interface IReporter

testFileComplete

public final void testFileComplete(boolean success)
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 final void echo(java.lang.String message)
Called from within the test from the SQLUnit Echo tag to print out values from within the test.

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