}
private IDataSet getDataSetObject(String path) throws Exception {
if (getDataSetStrategy().equals(DataSetStrategy.Xml)) {
return new XmlDataSet(Dbunit.class.getResourceAsStream(path));
} else if (getDataSetStrategy().equals(DataSetStrategy.FlatXml)) {
boolean enableColumnSensing = true;
InputStreamReader inReader = new InputStreamReader(Dbunit.class
.getResourceAsStream(path), "UTF-8");
// FlatXmlDataSet fxset = new FlatXmlDataSet(inReader, true,
// enableColumnSensing, false);
// return fxset;
return new CachedDataSet(new FlatXmlProducer(new InputSource(
inReader), true, enableColumnSensing, false));
} else {
return new XmlDataSet(Dbunit.class.getResourceAsStream(path));
}
}