X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=tests%2Forg%2Fcacert%2Fgigi%2FtestUtils%2FPingTest.java;h=14e002146098561b75d081fcdb22c338f9facc72;hb=e545cb295b12e3ecb0d777b2f2b6a601c9b27387;hp=50d5d7fc14696a97692c39e8fb85b35ec8feb9ed;hpb=280d6da278bcb19eb962fbc87403b88b1dc3e661;p=gigi.git diff --git a/tests/org/cacert/gigi/testUtils/PingTest.java b/tests/org/cacert/gigi/testUtils/PingTest.java index 50d5d7fc..14e00214 100644 --- a/tests/org/cacert/gigi/testUtils/PingTest.java +++ b/tests/org/cacert/gigi/testUtils/PingTest.java @@ -18,8 +18,14 @@ import org.cacert.gigi.database.GigiResultSet; import org.cacert.gigi.pages.account.domain.DomainOverview; import org.junit.After; +/** + * Base class for test suites that check extensively if the domain-ping + * functionality wroks as expected. + */ public abstract class PingTest extends ClientTest { + protected String csrf; + protected static void updateService(String token, String value, String action) throws IOException, MalformedURLException { String manage = getTestProps().getProperty("domain.manage"); assumeNotNull(manage); @@ -28,7 +34,7 @@ public abstract class PingTest extends ClientTest { } protected void waitForPings(int count) throws SQLException, InterruptedException { - GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT COUNT(*) FROM domainPinglog"); + GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT COUNT(*) FROM `domainPinglog`"); long start = System.currentTimeMillis(); while (System.currentTimeMillis() - start < 10000) { GigiResultSet rs = ps.executeQuery(); @@ -44,7 +50,7 @@ public abstract class PingTest extends ClientTest { URLConnection openConnection = u.openConnection(); openConnection.setRequestProperty("Cookie", cookie); openConnection.setDoOutput(true); - openConnection.getOutputStream().write(content.getBytes()); + openConnection.getOutputStream().write(content.getBytes("UTF-8")); openConnection.getHeaderField("Location"); String newcontent = IOUtils.readURL(cookie(u.openConnection(), cookie));