From: Felix Dörre Date: Mon, 22 Sep 2014 17:03:57 +0000 (+0200) Subject: UPD: Assume ping-env tests X-Git-Url: https://code.wpia.club/?p=gigi.git;a=commitdiff_plain;h=1513e7223708e0f8a04b2e0ceebf27b3469a6bec;hp=e8011a7009c1e8e918ebe975a11f6f02040d6377 UPD: Assume ping-env tests --- diff --git a/tests/org/cacert/gigi/ping/TestDNS.java b/tests/org/cacert/gigi/ping/TestDNS.java index 606efa29..a298cdca 100644 --- a/tests/org/cacert/gigi/ping/TestDNS.java +++ b/tests/org/cacert/gigi/ping/TestDNS.java @@ -1,6 +1,7 @@ package org.cacert.gigi.ping; import static org.junit.Assert.*; +import static org.junit.Assume.*; import java.io.IOException; import java.net.URL; @@ -60,6 +61,7 @@ public class TestDNS extends PingTest { public void testEmailAndDNS(int dnsVariant, int emailVariant, boolean successDNS, boolean successMail) throws IOException, InterruptedException, SQLException, NamingException { String test = getTestProps().getProperty("domain.dnstest"); + assumeNotNull(test); URL u = new URL("https://" + getServerName() + DomainOverview.PATH); Matcher m = initailizeDomainForm(u); @@ -91,8 +93,11 @@ public class TestDNS extends PingTest { private String readDNS(String token) throws NamingException { String test = getTestProps().getProperty("domain.dnstest"); + assumeNotNull(test); String targetDomain = token + "._cacert._auth." + test; - String[] data = DNSUtil.getTXTEntries(targetDomain, getTestProps().getProperty("domain.testns")); + String testns = getTestProps().getProperty("domain.testns"); + assumeNotNull(testns); + String[] data = DNSUtil.getTXTEntries(targetDomain, testns); assertEquals(1, data.length); return data[0]; diff --git a/tests/org/cacert/gigi/ping/TestHTTP.java b/tests/org/cacert/gigi/ping/TestHTTP.java index ef780bef..dffab08f 100644 --- a/tests/org/cacert/gigi/ping/TestHTTP.java +++ b/tests/org/cacert/gigi/ping/TestHTTP.java @@ -1,6 +1,7 @@ package org.cacert.gigi.ping; import static org.junit.Assert.*; +import static org.junit.Assume.*; import java.io.IOException; import java.io.InputStreamReader; @@ -50,6 +51,7 @@ public class TestHTTP extends PingTest { public void testEmailAndHTTP(int httpVariant, int emailVariant, boolean successHTTP, boolean successMail) throws IOException, InterruptedException, SQLException { String test = getTestProps().getProperty("domain.http"); + assumeNotNull(test); URL u = new URL("https://" + getServerName() + DomainOverview.PATH); Matcher m = initailizeDomainForm(u); @@ -79,7 +81,9 @@ public class TestHTTP extends PingTest { } private String readHTTP(String token) throws IOException { - URL u = new URL("http://" + getTestProps().getProperty("domain.http") + "/cacert-" + token + ".txt"); + String httpDom = getTestProps().getProperty("domain.http"); + assumeNotNull(httpDom); + URL u = new URL("http://" + httpDom + "/cacert-" + token + ".txt"); return IOUtils.readURL(new InputStreamReader(u.openStream())).trim(); } diff --git a/tests/org/cacert/gigi/ping/TestSSL.java b/tests/org/cacert/gigi/ping/TestSSL.java index 26f27626..8684481e 100644 --- a/tests/org/cacert/gigi/ping/TestSSL.java +++ b/tests/org/cacert/gigi/ping/TestSSL.java @@ -1,6 +1,7 @@ package org.cacert.gigi.ping; import static org.junit.Assert.*; +import static org.junit.Assume.*; import java.io.IOException; import java.net.Socket; @@ -88,7 +89,7 @@ public class TestSSL extends PingTest { private void testEmailAndSSL(int sslVariant, int emailVariant, boolean successMail) throws IOException, InterruptedException, SQLException, GeneralSecurityException, GigiApiException { String test = getTestProps().getProperty("domain.local"); - + assumeNotNull(test); URL u = new URL("https://" + getServerName() + DomainOverview.PATH); initailizeDomainForm(u); diff --git a/tests/org/cacert/gigi/testUtils/PingTest.java b/tests/org/cacert/gigi/testUtils/PingTest.java index 5095d680..0a65ec51 100644 --- a/tests/org/cacert/gigi/testUtils/PingTest.java +++ b/tests/org/cacert/gigi/testUtils/PingTest.java @@ -1,6 +1,7 @@ package org.cacert.gigi.testUtils; import static org.junit.Assert.*; +import static org.junit.Assume.*; import java.io.IOException; import java.net.HttpURLConnection; @@ -21,6 +22,7 @@ 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()); }