upgradeFile.delete();
}
}
private void setup() throws Exception {
DBSetup dbSetup = new DBSetup(connection);
File minimalSchema = getFileFromResource(MINIMAL_VERSION_OF_SCHEMA, getClass().getClassLoader());
File currentSchema = getFileFromDbUtils("db-schema-combined.xml");
try {
replaceTokensInFile(minimalSchema);
replaceTokensInFile(currentSchema);
dbSetup.uninstall(currentSchema.getAbsolutePath());
dbSetup.setup(minimalSchema.getAbsolutePath());
} finally {
minimalSchema.delete();
currentSchema.delete();
}
File data = getFileFromResource(MINIMAL_VERSION_OF_DATA, getClass().getClassLoader());
try {
replaceTokensInFile(data);
dbSetup.setup(data.getAbsolutePath(), null, true, false);
} finally {
data.delete();
}
}