+ 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")
+ }, ImportType.TRUNCATE);
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ System.out.println(" in " + (System.currentTimeMillis() - ms) + " ms");
+ clearCaches();
+ }
+
+ public static void clearCaches() throws IOException {
+ ObjectCache.clearAllCaches();
+ String type = testProps.getProperty("type");
+ URL u = new URL("https://" + getServerName() + "/manage");
+ u.openConnection().getHeaderField("Location");
+ }
+