From: Felix Dörre Date: Mon, 2 May 2016 13:19:25 +0000 (+0200) Subject: upd: improve error message of ping tests X-Git-Url: https://code.wpia.club/?p=gigi.git;a=commitdiff_plain;h=ed2d14a0fb2a1ce8df9537c0e8895bb2f783adfc upd: improve error message of ping tests --- diff --git a/tests/org/cacert/gigi/testUtils/PingTest.java b/tests/org/cacert/gigi/testUtils/PingTest.java index fd5de700..31f45c99 100644 --- a/tests/org/cacert/gigi/testUtils/PingTest.java +++ b/tests/org/cacert/gigi/testUtils/PingTest.java @@ -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]+)'>");