use of org.jumpmind.symmetric.io.data.DbImport in project symmetric-ds by JumpMind.
the class DbExportImportTest method importXmlData.
@Test
public void importXmlData() throws Exception {
final String FILE = "/test-dbimport-1-xml-1.xml";
ISymmetricEngine engine = getSymmetricEngine();
DbImport importer = new DbImport(engine.getDatabasePlatform());
importer.setFormat(DbImport.Format.XML);
importer.setDropIfExists(true);
importer.setAlterCaseToMatchDatabaseDefaultCase(true);
importer.importTables(getClass().getResourceAsStream(FILE));
assertCountDbImportTableRecords(3);
// table should be dropped so this should work again
importer.importTables(getClass().getResourceAsStream(FILE));
assertCountDbImportTableRecords(3);
}
Aggregations