Class Operation

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.dbunit.ant.AbstractStep
org.dbunit.ant.Operation
All Implemented Interfaces:
Cloneable, DbUnitTaskStep

public class Operation extends AbstractStep
The Operation class is the step that defines which operation will be performed in the execution of the DbUnitTask task.
Since:
Jun 10, 2002
Version:
$Revision$
Author:
Timothy Ruppert, Ben Cox
  • Field Details

  • Constructor Details

    • Operation

      public Operation()
  • Method Details

    • getSrc

      public File[] getSrc()
      Returns the source files holding the operation's dataset.
      Returns:
      the source files holding the operation's dataset.
    • setSrc

      public void setSrc(File[] sources)
      Sets the source files holding the operation's dataset.
      Parameters:
      sources - the source files holding the operation's dataset.
    • setSrc

      public void setSrc(File src)
      Sets the single source file holding the operation's dataset.
      Parameters:
      src - the source file holding the operation's dataset.
    • addConfiguredFileset

      public void addConfiguredFileset(org.apache.tools.ant.types.FileSet fileSet)
      Adds the files matched by the given Ant fileset to the operation's dataset sources.
      Parameters:
      fileSet - the Ant fileset to add.
    • getFormat

      public String getFormat()
      Returns the dataset format, defaulting to "flat" when not set.
      Returns:
      the dataset format.
    • setFormat

      public void setFormat(String format)
      Sets the dataset format.
      Parameters:
      format - the dataset format.
    • isCombine

      public boolean isCombine()
      Returns whether multiple sources are combined into a single dataset.
      Returns:
      true if multiple sources are combined into a single dataset.
    • setCombine

      public void setCombine(boolean combine)
      Sets whether multiple sources are combined into a single dataset.
      Parameters:
      combine - true to combine multiple sources into a single dataset.
    • isTransaction

      public boolean isTransaction()
      Returns whether the operation runs within a transaction.
      Returns:
      true if the operation runs within a transaction.
    • setTransaction

      public void setTransaction(boolean transaction)
      Sets whether the operation runs within a transaction.
      Parameters:
      transaction - true to run the operation within a transaction.
    • getNullToken

      public String getNullToken()
      Returns the token replaced with a null value in the dataset.
      Returns:
      the token replaced with a null value in the dataset.
    • setNullToken

      public void setNullToken(String nullToken)
      Sets the token to replace with a null value in the dataset.
      Parameters:
      nullToken - the token to replace with a null value in the dataset.
    • getDbOperation

      public DatabaseOperation getDbOperation()
      Returns the database operation resolved from setType(String).
      Returns:
      the database operation resolved from setType(String).
    • getType

      public String getType()
      Returns the operation type name.
      Returns:
      the operation type name.
    • setType

      public void setType(String type)
      Sets the operation type, resolving it to the corresponding DatabaseOperation.
      Parameters:
      type - one of: UPDATE, INSERT, REFRESH, DELETE, DELETE_ALL, CLEAN_INSERT, NONE, MSSQL_CLEAN_INSERT, MSSQL_INSERT, or MSSQL_REFRESH.
    • execute

      public void execute(IDatabaseConnection connection) throws DatabaseUnitException
      Description copied from interface: DbUnitTaskStep
      Executes this step using the given database connection.
      Parameters:
      connection - the database connection to use.
      Throws:
      DatabaseUnitException - if the step fails.
    • getLogMessage

      public String getLogMessage()
      Description copied from interface: DbUnitTaskStep
      Returns a message describing this step, for logging purposes.
      Returns:
      a message describing this step.
    • toString

      public String toString()
      Overrides:
      toString in class AbstractStep