X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=tests%2Forg%2Fcacert%2Fgigi%2Fpages%2Faccount%2FTestDomain.java;h=49f1b85cb03940b8be38602ed198a3b5b0413d74;hb=ff8b2a0142c24f22a0fac2518eb0a6cd6b95ef12;hp=1a3a5a081f3cdbbeef92838061d739ec82073b3b;hpb=aa5723dbb64ec8efa63909d39ff72364f0a5ee96;p=gigi.git diff --git a/tests/org/cacert/gigi/pages/account/TestDomain.java b/tests/org/cacert/gigi/pages/account/TestDomain.java index 1a3a5a08..49f1b85c 100644 --- a/tests/org/cacert/gigi/pages/account/TestDomain.java +++ b/tests/org/cacert/gigi/pages/account/TestDomain.java @@ -5,6 +5,7 @@ import static org.junit.Assert.*; import java.io.IOException; import java.net.URLEncoder; +import org.cacert.gigi.dbObjects.Domain; import org.cacert.gigi.pages.account.domain.DomainOverview; import org.cacert.gigi.testUtils.ClientTest; import org.junit.Test; @@ -19,6 +20,31 @@ public class TestDomain extends ClientTest { assertNotNull(addDomain(cookie, uniq + ".de")); } + @Test + public void testInvalid() throws IOException { + assertNotNull(addDomain(cookie, uniq + ".invalid")); + } + + @Test + public void testHighFinancialValue() throws IOException { + assertNotNull(addDomain(cookie, "google.com")); + } + + @Test + public void testDelete() throws IOException { + String domain = uniq + ".de"; + assertNull(addDomain(cookie, domain)); + Domain d0 = Domain.searchDomain(domain); + assertNull(executeBasicWebInteraction(cookie, DomainOverview.PATH, "delete=" + d0.getId(), 0)); + // double delete + assertNotNull(executeBasicWebInteraction(cookie, DomainOverview.PATH, "delete=" + d0.getId(), 0)); + // re-add + assertNull(addDomain(cookie, domain)); + Domain d1 = Domain.searchDomain(domain); + assertNotEquals(d0.getId(), d1.getId()); + assertNull(executeBasicWebInteraction(cookie, DomainOverview.PATH, "delete=" + d1.getId(), 0)); + } + public static String addDomain(String session, String domain) throws IOException { return executeBasicWebInteraction(session, DomainOverview.PATH, "adddomain&newdomain=" + URLEncoder.encode(domain, "UTF-8"), 1); }