X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fclub%2Fwpia%2Fgigi%2FtestUtils%2FPingTest.java;h=06a9444115ad429d17aecd43f2ea9d104400a8a1;hb=ac3bac5a7cdbb446da41aeb3397e02fa7a41ed60;hp=87ea982f5dc35c3095dda59062fb5f54da0fc737;hpb=bccd4cc0dba0f89aa045b113bac46eb8cc1dab4e;p=gigi.git diff --git a/tests/club/wpia/gigi/testUtils/PingTest.java b/tests/club/wpia/gigi/testUtils/PingTest.java index 87ea982f..06a94441 100644 --- a/tests/club/wpia/gigi/testUtils/PingTest.java +++ b/tests/club/wpia/gigi/testUtils/PingTest.java @@ -21,7 +21,7 @@ import club.wpia.gigi.util.SystemKeywords; /** * Base class for test suites that check extensively if the domain-ping - * functionality wroks as expected. + * functionality works as expected. */ public abstract class PingTest extends ClientTest { @@ -34,7 +34,7 @@ public abstract class PingTest extends ClientTest { assertEquals(200, ((HttpURLConnection) new URL(url).openConnection()).getResponseCode()); } - protected void waitForPings(int count) throws SQLException, InterruptedException { + protected void waitForPings(int count) throws InterruptedException { try (GigiPreparedStatement ps = new GigiPreparedStatement("SELECT COUNT(*) FROM `domainPinglog`")) { long start = System.currentTimeMillis(); while (System.currentTimeMillis() - start < 10000) { @@ -77,6 +77,12 @@ public abstract class PingTest extends ClientTest { return m; } + /** + * Needs to be @After class. In order to init {@link ClientTest#id} + * correctly, this needs to be after test. Before test this might be + * executed after the init of {@link ClientTest#id} and make that value + * invalid. + */ @After public void purgeDbAfterTest() throws SQLException, IOException { purgeDatabase();