use of org.dbunit.database.DatabaseDataSourceConnection in project head by mifos.
the class AcceptanceDatabaseTestUtils method deleteDataFromTable.
public void deleteDataFromTable(String tableName, DriverManagerDataSource dataSource) throws IOException, DataSetException, SQLException, DatabaseUnitException {
StringReader dataSetXmlStream = new StringReader("<dataset><" + tableName + "/></dataset>");
IDataSet dataSet = new FlatXmlDataSet(dataSetXmlStream);
IDatabaseConnection databaseConnection = new DatabaseDataSourceConnection(dataSource);
databaseConnection.getConfig().setProperty(DatabaseConfig.FEATURE_CASE_SENSITIVE_TABLE_NAMES, Boolean.TRUE);
DatabaseOperation.CLEAN_INSERT.execute(databaseConnection, dataSet);
}
use of org.dbunit.database.DatabaseDataSourceConnection in project jbehave-core by jbehave.
the class DbUnitSteps method deleteAllData.
@BeforeStory
public void deleteAllData() throws SQLException, DatabaseUnitException {
DatabaseDataSourceConnection dbConn = new DatabaseDataSourceConnection(dataSource);
IDataSet dataSet = dbConn.createDataSet(new String[] { "ORGANIZATION", "APPLICATION_USER" });
DatabaseOperation.DELETE_ALL.execute(dbConn, dataSet);
}
Aggregations