]> WPIA git - gigi.git/commitdiff
Enable cache-clearance for autonomous test-launches
authorFelix Dörre <felix@dogcraft.de>
Sat, 1 Nov 2014 20:29:34 +0000 (21:29 +0100)
committerJanis Streib <janis@dogcraft.de>
Wed, 31 Dec 2014 01:35:57 +0000 (02:35 +0100)
src/org/cacert/gigi/DevelLauncher.java
src/org/cacert/gigi/Launcher.java
src/org/cacert/gigi/dbObjects/CertificateOwner.java
tests/org/cacert/gigi/testUtils/ManagedTest.java

index f7bd763cdd59d9aaf80b55b4ab4874157b93ccc7..6a462f21ccae7a7a5a9d394049d6537dd960f442 100644 (file)
@@ -66,7 +66,7 @@ public class DevelLauncher {
         System.exit(0);
     }
 
         System.exit(0);
     }
 
-    private static void addDevelPage() {
+    public static void addDevelPage() {
         try {
             Field instF = Gigi.class.getDeclaredField("instance");
             Field pageF = Gigi.class.getDeclaredField("pages");
         try {
             Field instF = Gigi.class.getDeclaredField("instance");
             Field pageF = Gigi.class.getDeclaredField("pages");
index a47c9bfda7ed7f1699030ef6f7d203ac61b2ed2c..177d63eed5925b18bed89a27e873990af3ac2d6e 100644 (file)
@@ -84,6 +84,9 @@ public class Launcher {
                 Log.getLogger(Launcher.class).warn("Couldn't set uid!");
             }
         }
                 Log.getLogger(Launcher.class).warn("Couldn't set uid!");
             }
         }
+        if (conf.getMainProps().containsKey("testrunner")) {
+            DevelLauncher.addDevelPage();
+        }
     }
 
     private static ServerConnector createConnector(GigiConfig conf, Server s, HttpConfiguration httpConfig, boolean doHttps) throws GeneralSecurityException, IOException {
     }
 
     private static ServerConnector createConnector(GigiConfig conf, Server s, HttpConfiguration httpConfig, boolean doHttps) throws GeneralSecurityException, IOException {
index 7c111beea4b1ecfb26b50acebe4e3b6f3cb2cf7c..b41a404ae35f525e5921a4e11c7e5aa34b2cc220 100644 (file)
@@ -130,7 +130,7 @@ public abstract class CertificateOwner implements IdCachable {
     }
 
     public void delete() {
     }
 
     public void delete() {
-        GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("UPDATE certowners set deleted=NOW() WHERE id=?");
+        GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("UPDATE certOwners set deleted=NOW() WHERE id=?");
         ps.setInt(1, getId());
         ps.execute();
         myCache.remove(this);
         ps.setInt(1, getId());
         ps.execute();
         myCache.remove(this);
index 2303ef70a3dcb8b7b96eb61535e2d1f32e9ca186..6f6dfcf4e6035c8c603926147bca91528343f169 100644 (file)
@@ -161,14 +161,13 @@ public class ManagedTest extends ConfiguredTest {
     public static void clearCaches() throws IOException {
         ObjectCache.clearAllCaches();
         String type = testProps.getProperty("type");
     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");
-        }
+        URL u = new URL("https://" + getServerName() + "/manage");
+        u.openConnection().getHeaderField("Location");
     }
 
     private static Properties generateMainProps() {
         Properties mainProps = new Properties();
     }
 
     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"));
         mainProps.setProperty("host", "127.0.0.1");
         mainProps.setProperty("name.secure", testProps.getProperty("name.secure"));
         mainProps.setProperty("name.www", testProps.getProperty("name.www"));