]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/testUtils/PingTest.java
upd: enforce a more strict Form call pattern.
[gigi.git] / tests / org / cacert / gigi / testUtils / PingTest.java
index 967fdb2ded062a95e998f640767bd77ecbee4cfc..55c5683ac46a965ceda4f473586261bfb90e604b 100644 (file)
@@ -53,16 +53,16 @@ public abstract class PingTest extends ClientTest {
         openConnection.getHeaderField("Location");
         int code = ((HttpURLConnection) openConnection).getResponseCode();
         if (code != 302) {
-            throw new Error("Code was: " + code + "\ncontent was: " + IOUtils.readURL(openConnection));
+            throw new Error("Code was: " + code + "\ncontent was: " + fetchStartErrorMessage(IOUtils.readURL(openConnection)));
         }
 
         String newcontent = IOUtils.readURL(get(DomainOverview.PATH));
-        Pattern dlink = Pattern.compile(DomainOverview.PATH + "([0-9]+)'>");
+        Pattern dlink = Pattern.compile(DomainOverview.PATH + "/([0-9]+)'>");
         Matcher m1 = dlink.matcher(newcontent);
         if ( !m1.find()) {
             throw new Error(newcontent);
         }
-        return DomainOverview.PATH + m1.group(1);
+        return DomainOverview.PATH + "/" + m1.group(1);
     }
 
     protected Matcher initailizeDomainForm() throws IOException, Error {