com.github.springtestdbunit.dataset.XmlDataSetLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-test-dbunit-core Show documentation
Show all versions of spring-test-dbunit-core Show documentation
Core module for the integration between the Spring testing framework and DBUnit
package com.github.springtestdbunit.dataset;
import java.io.IOException;
import java.io.InputStream;
import org.dbunit.dataset.DataSetException;
import org.dbunit.dataset.IDataSet;
import org.dbunit.dataset.xml.XmlDataSet;
import org.springframework.core.io.Resource;
/**
* A {@link DataSetLoader data set loader} that can be used to load {@link XmlDataSet XmlDataSets}.
*
* @author Jorge Davison
* @since 1.3.0
*/
public class XmlDataSetLoader extends AbstractDataSetLoader {
@Override
protected IDataSet createDataSet(Resource resource) throws IOException, DataSetException {
InputStream inputStream = resource.getInputStream();
try {
return new XmlDataSet(inputStream);
} finally {
inputStream.close();
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy