net.sourceforge.sqlunit.ant
Class SqlunitTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by net.sourceforge.sqlunit.ant.SqlunitTask
Direct Known Subclasses:
XSqlunitTask

public class SqlunitTask
extends org.apache.tools.ant.Task

SqlunitTask is a custom ant task that accepts a testFile name and runs the SQLUnit test class with the given XML test script.

Version:
$Revision: 1.11 $
Author:
Sujit Pal (spal@users.sourceforge.net)

Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
SqlunitTask()
           
 
Method Summary
 void addFileSet(org.apache.tools.ant.types.FileSet fileSet)
          Sets the value of a list of SQLUnit XML test files specified by a nested fileSet element.
protected  IReporter createReporter()
           
 void execute()
          Executes the task.
 void setDebug(boolean debug)
          Sets the value of the attribute debug.
 void setFailureProperty(java.lang.String failureProperty)
          Sets the value of the failureProperty attribute.
 void setHaltOnFailure(boolean haltOnFailure)
          Sets the value of the attribute haltOnFailure.
 void setLogfile(java.lang.String logfile)
          Sets the value of the logfile attribute.
 void setLogformat(java.lang.String logformat)
          Sets the value of the attribute logformat.
 void setName(java.lang.String name)
          Sets the value of the attribute name.
 void setTestfile(java.lang.String testfile)
          Sets the value of the attribute testFile.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlunitTask

public SqlunitTask()
Method Detail

execute

public final void execute()
                   throws org.apache.tools.ant.BuildException
Executes the task.

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException - if thrown by the task

setTestfile

public final void setTestfile(java.lang.String testfile)
Sets the value of the attribute testFile.

Parameters:
testfile - the full path name of the test XML script.

setName

public final void setName(java.lang.String name)
Sets the value of the attribute name. If name is null, then the attribute is not changed.

Parameters:
name - the name of the test case (for reporting purposes).

setHaltOnFailure

public final void setHaltOnFailure(boolean haltOnFailure)
Sets the value of the attribute haltOnFailure.

Parameters:
haltOnFailure - can be set to true or false. Defaults to false.

setFailureProperty

public final void setFailureProperty(java.lang.String failureProperty)
Sets the value of the failureProperty attribute.

Parameters:
failureProperty - name of ant property.

setDebug

public final void setDebug(boolean debug)
Sets the value of the attribute debug.

Parameters:
debug - can be set to true or false. If true, returns the full stack trace of where the problem occured, else returns a short error message.

setLogformat

public final void setLogformat(java.lang.String logformat)
Sets the value of the attribute logformat.

Parameters:
logformat - the log format to set.

setLogfile

public final void setLogfile(java.lang.String logfile)
Sets the value of the logfile attribute.

Parameters:
logfile - the file name to which to log SQLUnit output. If not set, the output will be sent to STDERR. Note that each run of SQLUnit will overwrite the log file.

addFileSet

public final void addFileSet(org.apache.tools.ant.types.FileSet fileSet)
Sets the value of a list of SQLUnit XML test files specified by a nested fileSet element.

Parameters:
fileSet - the fileSet to add.

createReporter

protected IReporter createReporter()
                            throws java.lang.Exception
Throws:
java.lang.Exception