@Test
public void testDomain() throws InterruptedException, GigiApiException {
assertEquals(0, us.getDomains().length);
- Domain d = new Domain(us, "v1example.org");
- assertEquals(0, d.getId());
- d.insert();
+ Domain d = new Domain(us, us, "v1example.org");
Domain[] domains = us.getDomains();
assertEquals(1, domains.length);
assertEquals("v1example.org", domains[0].getSuffix());
assertNotEquals(0, d.getId());
assertEquals(d.getId(), domains[0].getId());
- Domain d2 = new Domain(us, "v2-example.org");
- assertEquals(0, d2.getId());
- d2.insert();
+ new Domain(us, us, "v2-example.org");
domains = us.getDomains();
assertEquals(2, domains.length);
@Test
public void testDoubleDomain() throws InterruptedException, GigiApiException {
- Domain d = new Domain(us, "dub-example.org");
- d.insert();
+ new Domain(us, us, "dub-example.org");
try {
- Domain d2 = new Domain(us, "dub-example.org");
- d2.insert();
+ new Domain(us, us, "dub-example.org");
fail("expected exception");
} catch (GigiApiException e) {
// expected
@Test
public void testDoubleDomainDelete() throws InterruptedException, GigiApiException {
- Domain d = new Domain(us, "delexample.org");
- d.insert();
+ Domain d = new Domain(us, us, "delexample.org");
d.delete();
- Domain d2 = new Domain(us, "delexample.org");
- d2.insert();
- }
-
- @Test
- public void testDoubleInsertDomain() throws InterruptedException, GigiApiException {
- Domain d = new Domain(us, "dins-example.org");
- d.insert();
- try {
- d.insert();
- fail("expected exception");
- } catch (GigiApiException e) {
- // expected
- }
+ new Domain(us, us, "delexample.org");
}
}