]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/testUtils/PingTest.java
UPD: Assume ping-env tests
[gigi.git] / tests / org / cacert / gigi / testUtils / PingTest.java
index 9007ec25811b5d4044bf3220a6ad95fecc35a480..0a65ec51f44e734181b7c5969d3a4eb12f9b5c08 100644 (file)
@@ -1,19 +1,20 @@
 package org.cacert.gigi.testUtils;
 
 import static org.junit.Assert.*;
+import static org.junit.Assume.*;
 
 import java.io.IOException;
 import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLConnection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import org.cacert.gigi.database.DatabaseConnection;
+import org.cacert.gigi.database.GigiPreparedStatement;
+import org.cacert.gigi.database.GigiResultSet;
 import org.cacert.gigi.pages.account.domain.DomainOverview;
 import org.junit.Before;
 
@@ -21,15 +22,16 @@ public abstract class PingTest extends ClientTest {
 
     protected static void updateService(String token, String value, String action) throws IOException, MalformedURLException {
         String manage = getTestProps().getProperty("domain.manage");
+        assumeNotNull(manage);
         String url = manage + "t1=" + token + "&t2=" + value + "&action=" + action;
         assertEquals(200, ((HttpURLConnection) new URL(url).openConnection()).getResponseCode());
     }
 
     protected void waitForPings(int count) throws SQLException, InterruptedException {
-        PreparedStatement 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) {
-            ResultSet rs = ps.executeQuery();
+            GigiResultSet rs = ps.executeQuery();
             rs.next();
             if (rs.getInt(1) >= count) {
                 break;