org.unitils.dbunit
Class DbUnitUnitils

java.lang.Object
  extended by org.unitils.dbunit.DbUnitUnitils

public class DbUnitUnitils
extends Object

Class providing access to the functionality of the dbunit module using static methods. Meant to be used directly in unit tests.

Author:
Filip Neven, Tim Ducheyne

Constructor Summary
DbUnitUnitils()
           
 
Method Summary
static void insertDataSet(File dataSetFile)
          Inserts the test data coming from the given DbUnit dataset file, using the default DataSetLoadStrategy and DataSetFactory class.
static void insertDataSet(File dataSetFile, Class<? extends DataSetFactory> dataSetFactoryClass, Class<? extends DataSetLoadStrategy> dataSetLoadStrategyClass)
          Inserts the test data coming from the given DbUnit dataset file.
static void insertDataSet(String... dataSetFileNames)
          Inserts the dataset consisting of the given list of files into the database
static void insertDefaultDataSet()
          Inserts the default dataset for the given test class into the database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbUnitUnitils

public DbUnitUnitils()
Method Detail

insertDefaultDataSet

public static void insertDefaultDataSet()
Inserts the default dataset for the given test class into the database


insertDataSet

public static void insertDataSet(String... dataSetFileNames)
Inserts the dataset consisting of the given list of files into the database

Parameters:
dataSetFileNames - The names of the files that define the test data

insertDataSet

public static void insertDataSet(File dataSetFile)
Inserts the test data coming from the given DbUnit dataset file, using the default DataSetLoadStrategy and DataSetFactory class.

Parameters:
dataSetFile - The test data set, not null

insertDataSet

public static void insertDataSet(File dataSetFile,
                                 Class<? extends DataSetFactory> dataSetFactoryClass,
                                 Class<? extends DataSetLoadStrategy> dataSetLoadStrategyClass)
Inserts the test data coming from the given DbUnit dataset file.

Parameters:
dataSetFile - The test data set, not null
dataSetFactoryClass - The class of the factory that must be used to read this dataset
dataSetLoadStrategyClass - The class of the load strategy that must be used to load this dataset


Copyright © 2011. All Rights Reserved.