]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/testUtils/PingTest.java
upd: improve error message of ping tests
[gigi.git] / 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]+)'>");