Class DbUnitServiceImpl

  extended by org.spicefactory.pimento.test.DbUnitServiceImpl
All Implemented Interfaces:

public class DbUnitServiceImpl
extends Object
implements DbUnitService

Default implementation for the DbUnitService. This implementation supports a testMode property that can be used to explicitly enable this service.

This service must never be exposed in a production environment since it would allow anyone to wipe out the entire database if the service would not be protected. For this reason it is disabled by default.

Jens Halm

Constructor Summary
DbUnitServiceImpl(DataSource dataSource)
          Creates a new instance.
Method Summary
 void prepareTables(String data)
          Prepares the database according to the specified XML.
 void setTestMode(boolean testMode)
          Sets whether this service is enabled
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public DbUnitServiceImpl(DataSource dataSource)
Creates a new instance.

dataSource - the DataSource to use to populate the database
Method Detail


public void setTestMode(boolean testMode)
Sets whether this service is enabled

testMode - true if this service should be enabled


public void prepareTables(String data)
Description copied from interface: DbUnitService
Prepares the database according to the specified XML. The XML has to be in the "XML Data Set" format supported by DbUnit. The "Flat XML Data Set" is currently not supported.

Specified by:
prepareTables in interface DbUnitService
data - the XML to populate the database from as a String