Search in sources :

Example 1 with LowerCaseDataSet

use of org.dbunit.dataset.LowerCaseDataSet in project activityinfo by bedatadriven.

the class DbUnit method loadDatset.

public void loadDatset(URL resource) throws Throwable {
    InputStream in = Resources.asByteSource(resource).openStream();
    Preconditions.checkNotNull("Cannot find xml file " + resource);
    LowerCaseDataSet dataSet = new LowerCaseDataSet(new FlatXmlDataSetBuilder().setDtdMetadata(true).setColumnSensing(true).build(new InputStreamReader(in)));
    IDatabaseConnection dbUnitConnection = new MySqlConnection(connection, null);
    InsertIdentityOperation.INSERT.execute(dbUnitConnection, dataSet);
}
Also used : LowerCaseDataSet(org.dbunit.dataset.LowerCaseDataSet) InputStreamReader(java.io.InputStreamReader) InputStream(java.io.InputStream) MySqlConnection(org.dbunit.ext.mysql.MySqlConnection) IDatabaseConnection(org.dbunit.database.IDatabaseConnection) FlatXmlDataSetBuilder(org.dbunit.dataset.xml.FlatXmlDataSetBuilder)

Aggregations

InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 IDatabaseConnection (org.dbunit.database.IDatabaseConnection)1 LowerCaseDataSet (org.dbunit.dataset.LowerCaseDataSet)1 FlatXmlDataSetBuilder (org.dbunit.dataset.xml.FlatXmlDataSetBuilder)1 MySqlConnection (org.dbunit.ext.mysql.MySqlConnection)1