@Override public int compareTo(Domain other) { return id.compareTo(other.getId()); }
@Override public int compareTo(Domain other) { return id.compareTo(other.getId()); }
@Override public int compareTo(Domain other) { return id.compareTo(other.getId()); }
@Test public void testCreateUpdateDeleteDomain() { skipIfNotDomainAdmin(); Domain domain = null; try { domain = domainClient.createDomain(prefix + "-domain"); checkDomain(domain, rootDomain, prefix + "-domain"); Domain updated = domainClient.updateDomain(domain.getId(), name(prefix + "-domain-2")); checkDomain(updated, rootDomain, prefix + "-domain-2"); assertEquals(updated.getId(), domain.getId()); } finally { if (domain != null) { domainClient.deleteDomainAndAttachedResources(domain.getId()); } } assertNull(domainClient.getDomainById(domain.getId())); }
@Test(expectedExceptions = IllegalStateException.class) public void testCreateUpdateDeleteDomain() throws InterruptedException { skipIfNotDomainAdmin(); Domain domain = null; try { domain = domainClient.createDomain(prefix + "-domain"); checkDomain(domain, rootDomain, prefix + "-domain"); Domain updated = domainClient.updateDomain(domain.getId(), name(prefix + "-domain-2")); checkDomain(updated, rootDomain, prefix + "-domain-2"); assertEquals(updated.getId(), domain.getId()); } finally { if (domain != null) { domainClient.deleteDomainAndAttachedResources(domain.getId()); } } Thread.sleep(5000); assertNull(domainClient.getDomainById(domain.getId())); }
private void checkDomain(Domain domain, Domain rootDomain, String expectedName) { assertEquals(domain.getParentDomainId(), rootDomain.getId()); assertEquals(domain.getName(), expectedName); assertEquals(domain.getParentDomainName(), rootDomain.getName()); } }
private void checkDomain(Domain domain, Domain rootDomain, String expectedName) { assertEquals(domain.getParentDomainId(), rootDomain.getId()); assertEquals(domain.getName(), expectedName); assertEquals(domain.getParentDomainName(), rootDomain.getName()); } }
private void checkDomain(Domain domain) { assertNotNull(domain.getId()); if (domain.getLevel() == 0 /* global ROOT */) { assertNull(domain.getParentDomainName()); assertNull(domain.getParentDomainId()); } else { assertNotNull(domain.getParentDomainName()); assertNotNull(domain.getParentDomainId()); } }
private void checkDomain(Domain domain) { assertNotNull(domain.getId()); if (domain.getLevel() == 0 /* global ROOT */) { assertNull(domain.getParentDomainName()); assertNull(domain.getParentDomainId()); } else { assertNotNull(domain.getParentDomainName()); assertNotNull(domain.getParentDomainId()); } }
@Test public void testListDomainChildren() { skipIfNotDomainAdmin(); Set<Domain> domains = domainAdminClient.getDomainClient().listDomains(); Domain root = findRootOfVisibleTree(domains); if (domains.size() > 1) { assertTrue(root.hasChild()); } Set<Domain> children = domainAdminClient.getDomainClient() .listDomainChildren(parentDomainId(root.getId()).isRecursive(true)); assertEquals(domains.size() - 1, children.size()); assertTrue(Sets.difference(domains, children).contains(root)); }
@Test public void testListDomainChildren() { skipIfNotDomainAdmin(); Set<Domain> domains = domainAdminClient.getDomainClient().listDomains(); Domain root = findRootOfVisibleTree(domains); if (domains.size() > 1) { assertTrue(root.hasChild()); } Set<Domain> children = domainAdminClient.getDomainClient() .listDomainChildren(parentDomainId(root.getId()).isRecursive(true)); assertEquals(domains.size() - 1, children.size()); assertTrue(Sets.difference(domains, children).contains(root)); }
public T fromDomain(Domain in) { return this .id(in.getId()) .hasChild(in.hasChild()) .level(in.getLevel()) .name(in.getName()) .networkDomain(in.getNetworkDomain()) .parentDomainId(in.getParentDomainId()) .parentDomainName(in.getParentDomainName()); } }
public T fromDomain(Domain in) { return this .id(in.getId()) .hasChild(in.hasChild()) .level(in.getLevel()) .name(in.getName()) .networkDomain(in.getNetworkDomain()) .parentDomainId(in.getParentDomainId()) .parentDomainName(in.getParentDomainName()); } }
public T fromDomain(Domain in) { return this .id(in.getId()) .hasChild(in.hasChild()) .level(in.getLevel()) .name(in.getName()) .networkDomain(in.getNetworkDomain()) .parentDomainId(in.getParentDomainId()) .parentDomainName(in.getParentDomainName()); } }