org.jete.db
Class DBSetupAction

java.lang.Object
  extended byorg.jete.cases.ValidatedTestAction
      extended byorg.jete.db.DBSetupAction
All Implemented Interfaces:
TestAction

public class DBSetupAction
extends ValidatedTestAction

Action to perform dbunit setup behavior. All behaviors are defined by the DatabaseOperation class, these include:

These operations are specified by passing the desired operation as a String. e.g. "TRUNCATE_TABLE". The operation map is configured by the standard operation map factory, or by some other user defined means (like passing the DB operations, or creating your own factory).

Operations may be configured differently via Spring to add additional, or specific DBUnit DatabaseOperation support via the standard getter / setter paradigm.

If a dataset is set (not null), then that is used over any DataSetWrapper that is specified.

Version:
$Id: DBSetupAction.html,v 1.3 2006/03/12 02:46:57 tdeast Exp $

Constructor Summary
DBSetupAction()
           
 
Method Summary
protected  void doAction()
          Convert the specified db operation into the DBUnit specific operation.
 org.dbunit.dataset.IDataSet getDataSet()
           
 DataSetWrapper getDataSetWrapper()
           
 javax.sql.DataSource getDataSource()
           
 java.util.Collection getDbOperations()
           
 void setDataSet(org.dbunit.dataset.IDataSet dataSet)
           
 void setDataSetWrapper(DataSetWrapper dataSetWrapper)
           
 void setDataSource(javax.sql.DataSource dataSource)
           
 void setDbOperations(java.util.Collection dbOperations)
           
 
Methods inherited from class org.jete.cases.ValidatedTestAction
getValidators, runAction, setValidators
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBSetupAction

public DBSetupAction()
Method Detail

doAction

protected void doAction()
                 throws ActionException
Convert the specified db operation into the DBUnit specific operation. Then retrieve the specified DBUnit flat file data, create a DB connection based on the configuration, and execute the opertation.

Specified by:
doAction in class ValidatedTestAction
Throws:
ActionException

getDbOperations

public java.util.Collection getDbOperations()

setDbOperations

public void setDbOperations(java.util.Collection dbOperations)

getDataSource

public javax.sql.DataSource getDataSource()

setDataSource

public void setDataSource(javax.sql.DataSource dataSource)

getDataSetWrapper

public DataSetWrapper getDataSetWrapper()

setDataSetWrapper

public void setDataSetWrapper(DataSetWrapper dataSetWrapper)

getDataSet

public org.dbunit.dataset.IDataSet getDataSet()

setDataSet

public void setDataSet(org.dbunit.dataset.IDataSet dataSet)