org.silverpeas
Class DataSetTest

java.lang.Object
  extended by org.silverpeas.DataSetTest
Direct Known Subclasses:
DAOBasedTest, RepositoryBasedTest

public abstract class DataSetTest
extends Object


Nested Class Summary
 class DataSetTest.TableRow
          Class to extract data easily from a table row.
 
Constructor Summary
DataSetTest()
           
 
Method Summary
 org.dbunit.dataset.IDataSet getActualDataSet()
           
 org.springframework.context.ApplicationContext getApplicationContext()
           
abstract  String[] getApplicationContextPath()
          Gets the XML Spring configuration files from which the context will be bootstrapped for the test.
protected  Connection getConnection()
          Gets the database connection.
 org.dbunit.dataset.ReplacementDataSet getDataSet()
           
abstract  String getDataSetPath()
          Gets the path of the XML file in which are defined the data to insert into the database before the running of a test.
protected  DataSource getDataSource()
           
protected abstract  String getDataSourceInjectionBeanId()
          Gets the identifier which permits to retrieve the instance of the data source in the injection context.
 int getTableIndexFor(org.dbunit.dataset.ITable table, String columnName, Object value)
           
 int getTableIndexForId(org.dbunit.dataset.ITable table, Object id)
           
 DataSetTest.TableRow getTableRowFor(org.dbunit.dataset.ITable table, String columnName, Object value)
           
 List<DataSetTest.TableRow> getTableRowsFor(org.dbunit.dataset.ITable table, String columnName, Object value)
           
 void setUp()
           
 void tearDown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSetTest

public DataSetTest()
Method Detail

setUp

public void setUp()
           throws Exception
Throws:
Exception

getDataSourceInjectionBeanId

protected abstract String getDataSourceInjectionBeanId()
Gets the identifier which permits to retrieve the instance of the data source in the injection context.

Returns:

getDataSource

protected DataSource getDataSource()

getConnection

protected Connection getConnection()
                            throws SQLException
Gets the database connection.

Returns:
the database connection.
Throws:
SQLException

getDataSet

public org.dbunit.dataset.ReplacementDataSet getDataSet()
                                                 throws Exception
Throws:
Exception

tearDown

public void tearDown()
              throws Exception
Throws:
Exception

getDataSetPath

public abstract String getDataSetPath()
Gets the path of the XML file in which are defined the data to insert into the database before the running of a test.

Returns:
the path of the XML data set.

getApplicationContextPath

public abstract String[] getApplicationContextPath()
Gets the XML Spring configuration files from which the context will be bootstrapped for the test.

Returns:
the location of the Spring XML configuration files.

getActualDataSet

public org.dbunit.dataset.IDataSet getActualDataSet()
                                             throws Exception
Throws:
Exception

getTableIndexFor

public int getTableIndexFor(org.dbunit.dataset.ITable table,
                            String columnName,
                            Object value)
                     throws Exception
Throws:
Exception

getTableRowFor

public DataSetTest.TableRow getTableRowFor(org.dbunit.dataset.ITable table,
                                           String columnName,
                                           Object value)
                                    throws Exception
Throws:
Exception

getTableRowsFor

public List<DataSetTest.TableRow> getTableRowsFor(org.dbunit.dataset.ITable table,
                                                  String columnName,
                                                  Object value)
                                           throws Exception
Throws:
Exception

getTableIndexForId

public int getTableIndexForId(org.dbunit.dataset.ITable table,
                              Object id)
                       throws Exception
Throws:
Exception

getApplicationContext

public org.springframework.context.ApplicationContext getApplicationContext()


Copyright © 2016 Silverpeas. All Rights Reserved.