]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/testUtils/ManagedTest.java
Enable cache-clearance for autonomous test-launches
[gigi.git] / tests / org / cacert / gigi / testUtils / ManagedTest.java
index dff72da839de5481e4dce2944dbf9dd22364d571..6f6dfcf4e6035c8c603926147bca91528343f169 100644 (file)
@@ -46,9 +46,9 @@ 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.cacert.gigi.util.DatabaseManager.ImportType;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -155,16 +155,19 @@ public class ManagedTest extends ConfiguredTest {
             e.printStackTrace();
         }
         System.out.println(" in " + (System.currentTimeMillis() - ms) + " ms");
-        String type = testProps.getProperty("type");
+        clearCaches();
+    }
+
+    public static void clearCaches() throws IOException {
         ObjectCache.clearAllCaches();
-        if (type.equals("local")) {
-            URL u = new URL("https://" + getServerName() + "/manage");
-            u.openConnection().getHeaderField("Location");
-        }
+        String type = testProps.getProperty("type");
+        URL u = new URL("https://" + getServerName() + "/manage");
+        u.openConnection().getHeaderField("Location");
     }
 
     private static Properties generateMainProps() {
         Properties mainProps = new Properties();
+        mainProps.setProperty("testrunner", "true");
         mainProps.setProperty("host", "127.0.0.1");
         mainProps.setProperty("name.secure", testProps.getProperty("name.secure"));
         mainProps.setProperty("name.www", testProps.getProperty("name.www"));