]> WPIA git - gigi.git/commitdiff
upd: improve error message of ping tests
authorFelix Dörre <felix@dogcraft.de>
Mon, 2 May 2016 13:19:25 +0000 (15:19 +0200)
committerFelix Dörre <felix@dogcraft.de>
Mon, 2 May 2016 13:19:25 +0000 (15:19 +0200)
tests/org/cacert/gigi/testUtils/PingTest.java

index fd5de700daa9d0c87a0443cda2c3c097f54cabc4..31f45c99b8143c3e0d40e66ffccc70568a186d0e 100644 (file)
@@ -52,6 +52,9 @@ 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));
+        }
 
         String newcontent = IOUtils.readURL(cookie(u.openConnection(), cookie));
         Pattern dlink = Pattern.compile(DomainOverview.PATH + "([0-9]+)'>");