| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin.client.ldap; |
| | | |
| | |
| | | @Test(sequential=true) |
| | | public final class LDAPClientTest extends AdminTestCase { |
| | | |
| | | // Test LDIF. |
| | | /** Test LDIF. */ |
| | | private static final String[] TEST_LDIF = new String[] { |
| | | // Base entries. |
| | | "dn: cn=config", |
| | |
| | | Class<? extends Exception> expected) { |
| | | MockLDAPConnection c = new MockLDAPConnection() { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void createEntry(LdapName dn, Attributes attributes) |
| | | throws NamingException { |
| | |
| | | Class<? extends Exception> expected) { |
| | | MockLDAPConnection c = new MockLDAPConnection() { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Attributes readEntry(LdapName dn, Collection<String> attrIds) |
| | | throws NamingException { |
| | |
| | | |
| | | |
| | | |
| | | // Asserts that the actual set of DNs contains the expected values. |
| | | /** Asserts that the actual set of DNs contains the expected values. */ |
| | | private void assertDNSetEquals(SortedSet<DN> actual, String... expected) { |
| | | String[] actualStrings = new String[actual.size()]; |
| | | int i = 0; |
| | |
| | | |
| | | |
| | | |
| | | // Create the named test parent managed object. |
| | | /** Create the named test parent managed object. */ |
| | | private TestParentCfgClient createTestParent(ManagementContext context, |
| | | String name) throws ManagedObjectDecodingException, |
| | | AuthorizationException, ManagedObjectAlreadyExistsException, |
| | |
| | | |
| | | |
| | | |
| | | // Retrieve the named test parent managed object. |
| | | /** Retrieve the named test parent managed object. */ |
| | | private TestParentCfgClient getTestParent(ManagementContext context, |
| | | String name) throws DefinitionDecodingException, |
| | | ManagedObjectDecodingException, AuthorizationException, |
| | |
| | | |
| | | |
| | | |
| | | // List test parent managed objects. |
| | | /** List test parent managed objects. */ |
| | | private String[] listTestParents(ManagementContext context) |
| | | throws AuthorizationException, ConcurrentModificationException, |
| | | CommunicationException { |
| | |
| | | |
| | | |
| | | |
| | | // Remove the named test parent managed object. |
| | | /** Remove the named test parent managed object. */ |
| | | private void removeTestParent(ManagementContext context, String name) |
| | | throws AuthorizationException, ManagedObjectNotFoundException, |
| | | OperationRejectedException, ConcurrentModificationException, |