Interface DataSetProvider
public interface DataSetProvider
A provider of
IDataSet instances for DbUnit tests.
Implementations of this interface are responsible for creating and returning
a fully initialized IDataSet that will be used during database
setup or verification.
This allows consumers of the API to load DbUnit
datasets programmatically (for example, by reading from a file, building
an in-memory dataset, or querying another source).
Implementation notes:
- Each implementation must declare a public no-argument constructor.
- Implementations may construct the dataset lazily or eagerly, depending on performance or memory needs.
Typical usage:
public class MyDataSetProvider implements DataSetProvider {
@Override
public IDataSet get() throws Exception {
// Build and return an IDataSet instance
}
}
-
Method Summary
Modifier and TypeMethodDescriptionorg.dbunit.dataset.IDataSetget()Returns a DbUnitIDataSetto be used by the test framework.
-
Method Details
-
get
Returns a DbUnitIDataSetto be used by the test framework.This method will be invoked each time a dataset is required. It should construct and return a new or cached
IDataSet, depending on the needs of the implementation.- Returns:
- a fully constructed
IDataSetinstance. - Throws:
Exception- if an error occurs while creating or loading the dataset.
-