]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/testUtils/ManagedTest.java
ADD: output pinglog, test DNS and email ping.
[gigi.git] / tests / org / cacert / gigi / testUtils / ManagedTest.java
index a9dd42015c8bdb4930d9fb1e6225b69c2ef0ef5f..b0f3670a68f1be76e9077f337d392c6e3b9756a4 100644 (file)
@@ -78,6 +78,11 @@ public class ManagedTest {
     }
 
     static Properties testProps = new Properties();
+
+    public static Properties getTestProps() {
+        return testProps;
+    }
+
     static {
         InitTruststore.run();
         HttpURLConnection.setFollowRedirects(false);
@@ -395,6 +400,10 @@ public class ManagedTest {
 
     public static String getCSRF(URLConnection u, int formIndex) throws IOException {
         String content = IOUtils.readURL(u);
+        return getCSRF(formIndex, content);
+    }
+
+    public static String getCSRF(int formIndex, String content) throws Error {
         Pattern p = Pattern.compile("<input type='hidden' name='csrf' value='([^']+)'>");
         Matcher m = p.matcher(content);
         for (int i = 0; i < formIndex + 1; i++) {
@@ -459,4 +468,9 @@ public class ManagedTest {
         return adrr;
     }
 
+    public static URLConnection cookie(URLConnection openConnection, String cookie) {
+        openConnection.setRequestProperty("Cookie", cookie);
+        return openConnection;
+    }
+
 }