if ( !DatabaseConnection.isInited()) {
DatabaseConnection.init(testProps);
}
- System.out.println("... purging Database");
- DatabaseManager.run(new String[] {
- testProps.getProperty("sql.driver"), testProps.getProperty("sql.url"), testProps.getProperty("sql.user"), testProps.getProperty("sql.password")
- });
+ purgeDatabase();
String type = testProps.getProperty("type");
Properties mainProps = generateMainProps();
ServerConstants.init(mainProps);
SimpleSigner.runSigner();
} catch (IOException e) {
throw new Error(e);
- } catch (ClassNotFoundException e1) {
- e1.printStackTrace();
} catch (SQLException e1) {
e1.printStackTrace();
} catch (InterruptedException e) {
}
+ public static void purgeDatabase() throws SQLException, IOException {
+ System.out.print("... resetting Database");
+ long ms = System.currentTimeMillis();
+ try {
+ DatabaseManager.run(new String[] {
+ testProps.getProperty("sql.driver"), testProps.getProperty("sql.url"), testProps.getProperty("sql.user"), testProps.getProperty("sql.password")
+ }, true);
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ System.out.println(" in " + (System.currentTimeMillis() - ms) + " ms");
+ }
+
private static Properties generateMainProps() {
Properties mainProps = new Properties();
mainProps.setProperty("host", "127.0.0.1");