]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/testUtils/ManagedTest.java
ADD: Delete affiliations + testcase
[gigi.git] / tests / org / cacert / gigi / testUtils / ManagedTest.java
index cc023239250447d610fdeac22019f8236b85c7db..2303ef70a3dcb8b7b96eb61535e2d1f32e9ca186 100644 (file)
@@ -46,6 +46,7 @@ import org.cacert.gigi.pages.account.MyDetails;
 import org.cacert.gigi.pages.main.RegisterPage;
 import org.cacert.gigi.testUtils.TestEmailReciever.TestMail;
 import org.cacert.gigi.util.DatabaseManager;
+import org.cacert.gigi.util.DatabaseManager.ImportType;
 import org.cacert.gigi.util.ServerConstants;
 import org.cacert.gigi.util.SimpleSigner;
 import org.junit.After;
@@ -149,13 +150,17 @@ public class ManagedTest extends ConfiguredTest {
         try {
             DatabaseManager.run(new String[] {
                     testProps.getProperty("sql.driver"), testProps.getProperty("sql.url"), testProps.getProperty("sql.user"), testProps.getProperty("sql.password")
-            }, true);
+            }, ImportType.TRUNCATE);
         } catch (ClassNotFoundException e) {
             e.printStackTrace();
         }
         System.out.println(" in " + (System.currentTimeMillis() - ms) + " ms");
-        String type = testProps.getProperty("type");
+        clearCaches();
+    }
+
+    public static void clearCaches() throws IOException {
         ObjectCache.clearAllCaches();
+        String type = testProps.getProperty("type");
         if (type.equals("local")) {
             URL u = new URL("https://" + getServerName() + "/manage");
             u.openConnection().getHeaderField("Location");