]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/ping/TestDNS.java
Merge "Suggestions to enhance the SQL call pattern."
[gigi.git] / tests / org / cacert / gigi / ping / TestDNS.java
index 021012a196f25432106bbc34c663ba64760db8ee..8bb61461ecc745dddc8219919f445fd8cd2297e6 100644 (file)
@@ -4,7 +4,6 @@ import static org.junit.Assert.*;
 import static org.junit.Assume.*;
 
 import java.io.IOException;
-import java.net.URL;
 import java.net.URLEncoder;
 import java.sql.SQLException;
 import java.util.regex.Matcher;
@@ -12,13 +11,11 @@ import java.util.regex.Pattern;
 
 import javax.naming.NamingException;
 
-import org.cacert.gigi.pages.account.domain.DomainOverview;
 import org.cacert.gigi.testUtils.IOUtils;
 import org.cacert.gigi.testUtils.PingTest;
-import org.cacert.gigi.testUtils.TestEmailReciever.TestMail;
+import org.cacert.gigi.testUtils.TestEmailReceiver.TestMail;
 import org.cacert.gigi.util.DNSUtil;
 import org.cacert.gigi.util.RandomToken;
-import org.junit.Assert;
 import org.junit.Test;
 
 public class TestDNS extends PingTest {
@@ -64,8 +61,7 @@ public class TestDNS extends PingTest {
         String test = getTestProps().getProperty("domain.dnstest");
         assumeNotNull(test);
 
-        URL u = new URL("https://" + getServerName() + DomainOverview.PATH);
-        Matcher m = initailizeDomainForm(u);
+        Matcher m = initailizeDomainForm();
         updateService(m.group(1) + (dnsVariant == 1 ? "a" : ""), m.group(2) + (dnsVariant == 2 ? "a" : ""), "dns");
 
         String content = "newdomain=" + URLEncoder.encode(test, "UTF-8") + //
@@ -75,17 +71,16 @@ public class TestDNS extends PingTest {
                 "&ssl-type-2=direct&ssl-port-2=" + //
                 "&ssl-type-3=direct&ssl-port-3=" + //
                 "&adddomain&csrf=" + csrf;
-        URL u2 = sendDomainForm(u, content);
+        String p2 = sendDomainForm(content);
 
-        TestMail mail = getMailReciever().recieve();
+        TestMail mail = getMailReciever().receive();
         if (emailVariant == 0) {
-            Assert.assertNotNull(mail);
             mail.verify();
         }
 
         waitForPings(2);
 
-        String newcontent = IOUtils.readURL(cookie(u2.openConnection(), cookie));
+        String newcontent = IOUtils.readURL(get(p2));
         Pattern pat = Pattern.compile("<td>dns</td>\\s*<td>success</td>");
         assertTrue(newcontent, !successDNS ^ pat.matcher(newcontent).find());
         pat = Pattern.compile("<td>email</td>\\s*<td>success</td>");