|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.springtestdbunit.dataset.AbstractDataSetLoader
public abstract class AbstractDataSetLoader
Abstract data set loader, which provides a basis for concrete implementations of the DataSetLoader strategy.
Provides a Template Method based approach for loading data using a
Spring resource loader.
getResourceLoader(java.lang.Class>),
getResourceLocations(java.lang.Class>, java.lang.String),
createDataSet(Resource)| Constructor Summary | |
|---|---|
AbstractDataSetLoader()
|
|
| Method Summary | |
|---|---|
protected abstract org.dbunit.dataset.IDataSet |
createDataSet(org.springframework.core.io.Resource resource)
Factory method used to create the dataset |
protected org.springframework.core.io.ResourceLoader |
getResourceLoader(Class<?> testClass)
Gets the ResourceLoader that will be used to load the dataset Resources. |
protected String[] |
getResourceLocations(Class<?> testClass,
String location)
Get the resource locations that should be considered when attempting to load a dataset from the specified location. |
org.dbunit.dataset.IDataSet |
loadDataSet(Class<?> testClass,
String location)
Loads a dataset from Resources obtained from the specified location. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractDataSetLoader()
| Method Detail |
|---|
public org.dbunit.dataset.IDataSet loadDataSet(Class<?> testClass,
String location)
throws Exception
dataset from Resources obtained from the specified location. Each
location can be mapped to a number of potential resources, the first
resource that exists will be used. Resources are loaded using the
ResourceLoader returned from getResourceLoader(java.lang.Class>).
If no resource can be found then null will be returned.
loadDataSet in interface DataSetLoadertestClass - The class under testlocation - The location to load
dataset or null
Exception - If the dataset cannot be loadedcreateDataSet(Resource),
java.lang.String)protected org.springframework.core.io.ResourceLoader getResourceLoader(Class<?> testClass)
ResourceLoader that will be used to load the dataset Resources.
testClass - The class under test
protected String[] getResourceLocations(Class<?> testClass,
String location)
testClass - The class under testlocation - The source location
protected abstract org.dbunit.dataset.IDataSet createDataSet(org.springframework.core.io.Resource resource)
throws Exception
dataset
resource - an existing resource that contains the dataset data
Exception - if the dataset could not be loaded
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||