it.openutils.testing
Class DbUnitTestContext

java.lang.Object
  extended by it.openutils.testing.DbUnitTestContext

public class DbUnitTestContext
extends java.lang.Object

Version:
$Id: DbUnitTestContext.java 1301 2009-08-25 09:41:04Z mmunaretto $
Author:
fgiust

Field Summary
protected static java.util.Map<java.lang.String,org.dbunit.dataset.IDataSet> truncateDataSetCache
          Truncate dataset cache.
 
Constructor Summary
DbUnitTestContext(java.lang.Object testcase, org.springframework.context.ApplicationContext applicationContext)
          Instantiates a new DbUnitTestContext
 
Method Summary
protected  javax.sql.DataSource getDatasource(java.lang.String name)
          Loads a named datasource from the spring context.
 void setUpDbUnit()
          Setup the Database before running the test method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

truncateDataSetCache

protected static java.util.Map<java.lang.String,org.dbunit.dataset.IDataSet> truncateDataSetCache
Truncate dataset cache. This is kept as a static attribute since the creation of the dataset is very expensive and it doesn't change across tests.

Constructor Detail

DbUnitTestContext

public DbUnitTestContext(java.lang.Object testcase,
                         org.springframework.context.ApplicationContext applicationContext)
Instantiates a new DbUnitTestContext

Parameters:
testcase - test instance
applicationContext - Spring application context
Method Detail

setUpDbUnit

public void setUpDbUnit()
                 throws java.lang.Exception
Setup the Database before running the test method.

Throws:
java.lang.Exception - Any exception.

getDatasource

protected javax.sql.DataSource getDatasource(java.lang.String name)
Loads a named datasource from the spring context.

Parameters:
name - datasource name.
Returns:
Datasource instance


Copyright © 2005-2009 Openmind. All Rights Reserved.