X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=tests%2Forg%2Fcacert%2Fgigi%2FtestUtils%2FPingTest.java;h=55c5683ac46a965ceda4f473586261bfb90e604b;hb=8eaf45ee6a71969eff3e04b40e4435e0dd380824;hp=0d15f2e86c3cf5807c3a969d647b83e061103c89;hpb=1c7e27416fbfffcacf7b6f9a8765e9dd9671c2b7;p=gigi.git diff --git a/tests/org/cacert/gigi/testUtils/PingTest.java b/tests/org/cacert/gigi/testUtils/PingTest.java index 0d15f2e8..55c5683a 100644 --- a/tests/org/cacert/gigi/testUtils/PingTest.java +++ b/tests/org/cacert/gigi/testUtils/PingTest.java @@ -51,17 +51,18 @@ public abstract class PingTest extends ClientTest { openConnection.setDoOutput(true); openConnection.getOutputStream().write(content.getBytes("UTF-8")); openConnection.getHeaderField("Location"); - if (((HttpURLConnection) openConnection).getResponseCode() != 302) { - throw new Error(IOUtils.readURL(openConnection)); + int code = ((HttpURLConnection) openConnection).getResponseCode(); + if (code != 302) { + 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 {