public class DbUnitTask
extends org.apache.tools.ant.Task
DbUnitTask
is the task definition for an Ant
interface to DbUnit
. DbUnit is a JUnit extension
which sets your database to a known state before executing your
tasks.Task
Constructor and Description |
---|
DbUnitTask() |
Modifier and Type | Method and Description |
---|---|
void |
addCompare(Compare compare)
Adds a Compare to the steps List.
|
void |
addDbConfig(DbConfig dbConfig) |
void |
addExport(Export export)
Adds an Export to the steps List.
|
void |
addOperation(Operation operation)
Adds an Operation.
|
org.apache.tools.ant.types.Path |
createClasspath()
Create the classpath for loading the driver.
|
protected IDatabaseConnection |
createConnection() |
protected IDatabaseConnection |
createDatabaseConnection(Connection jdbcConnection,
String dbSchema)
Creates the dbunit connection using the two given arguments.
|
void |
execute()
Load the step and then execute it.
|
String |
getBatchSize() |
DbConfig |
getDbConfig() |
String |
getFetchSize() |
List |
getSteps()
Gets the Steps.
|
void |
setBatchSize(String batchSize)
sets the size of batch inserts.
|
void |
setClasspath(org.apache.tools.ant.types.Path classpath)
Set the classpath for loading the driver.
|
void |
setClasspathRef(org.apache.tools.ant.types.Reference r)
Set the classpath for loading the driver using the classpath reference.
|
void |
setDatatypeFactory(String datatypeFactory) |
void |
setDatatypeWarning(Boolean datatypeWarning) |
void |
setDriver(String driver)
Set the JDBC driver to be used.
|
void |
setEscapePattern(String escapePattern) |
void |
setFetchSize(String fetchSize) |
void |
setPassword(String password)
Set the password for the DB connection.
|
void |
setSchema(String schema)
Set the schema for the DB connection.
|
void |
setSkipOracleRecycleBinTables(Boolean skipOracleRecycleBinTables) |
void |
setSupportBatchStatement(Boolean supportBatchStatement)
Set the flag for supporting batch statements.
|
void |
setUrl(String url)
Set the DB connection url.
|
void |
setUseQualifiedTableNames(Boolean useQualifiedTableNames)
Set the flag for using the qualified table names.
|
void |
setUserid(String userId)
Set the user name for the DB connection.
|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
public void setDriver(String driver)
public void setUrl(String url)
public void setUserid(String userId)
public void setPassword(String password)
public void setSchema(String schema)
public void setUseQualifiedTableNames(Boolean useQualifiedTableNames)
public void setSupportBatchStatement(Boolean supportBatchStatement)
public void setDatatypeWarning(Boolean datatypeWarning)
public void setDatatypeFactory(String datatypeFactory)
public void setEscapePattern(String escapePattern)
public DbConfig getDbConfig()
public void addDbConfig(DbConfig dbConfig)
public void setClasspath(org.apache.tools.ant.types.Path classpath)
public org.apache.tools.ant.types.Path createClasspath()
public void setClasspathRef(org.apache.tools.ant.types.Reference r)
public List getSteps()
public void addOperation(Operation operation)
public void addCompare(Compare compare)
public void addExport(Export export)
public String getBatchSize()
public void setBatchSize(String batchSize)
batchSize
- public String getFetchSize()
public void setFetchSize(String fetchSize)
public void setSkipOracleRecycleBinTables(Boolean skipOracleRecycleBinTables)
public void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
protected IDatabaseConnection createConnection() throws SQLException
SQLException
protected IDatabaseConnection createDatabaseConnection(Connection jdbcConnection, String dbSchema)
jdbcConnection
- dbSchema
- Copyright © 2002–2024. All rights reserved.