| | |
| | | private static class AddListener implements |
| | | ConfigurationAddListener<TestChildCfg> { |
| | | |
| | | // The child configuration that was added. |
| | | /** The child configuration that was added. */ |
| | | private TestChildCfg child; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationAdd(TestChildCfg configuration) { |
| | | return new ConfigChangeResult(); |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationAddAcceptable(TestChildCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) { |
| | | child = configuration; |
| | |
| | | private static class ChangeListener implements |
| | | ConfigurationChangeListener<TestChildCfg> { |
| | | |
| | | // The child configuration that was changed. |
| | | /** The child configuration that was changed. */ |
| | | private TestChildCfg child; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange(TestChildCfg configuration) { |
| | | return new ConfigChangeResult(); |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable(TestChildCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) { |
| | | child = configuration; |
| | |
| | | |
| | | } |
| | | |
| | | // Test child 1 LDIF. |
| | | /** Test child 1 LDIF. */ |
| | | private static final String[] TEST_CHILD_1 = new String[] { |
| | | "dn: cn=test child 1,cn=test children,cn=test parent 1,cn=test parents,cn=config", |
| | | "objectclass: top", |
| | |
| | | "ds-cfg-conflict-behavior: virtual-overrides-real" |
| | | }; |
| | | |
| | | // Test child 2 LDIF. |
| | | /** Test child 2 LDIF. */ |
| | | private static final String[] TEST_CHILD_2 = new String[] { |
| | | "dn: cn=test child 2,cn=test children,cn=test parent 1,cn=test parents,cn=config", |
| | | "objectclass: top", |
| | |
| | | "ds-cfg-base-dn: dc=default value c2v2,dc=com" |
| | | }; |
| | | |
| | | // Test child 3 LDIF. |
| | | /** Test child 3 LDIF. */ |
| | | private static final String[] TEST_CHILD_3 = new String[] { |
| | | "dn: cn=test child 3,cn=test children,cn=test parent 1,cn=test parents,cn=config", |
| | | "objectclass: top", |
| | |
| | | "ds-cfg-group-dn: dc=default value c3v4,dc=com" |
| | | }; |
| | | |
| | | // Test child 4 LDIF. |
| | | /** Test child 4 LDIF. */ |
| | | private static final String[] TEST_CHILD_4 = new String[] { |
| | | "dn: cn=test child 4,cn=test children,cn=test parent 2,cn=test parents,cn=config", |
| | | "objectclass: top", |
| | |
| | | "ds-cfg-conflict-behavior: virtual-overrides-real" |
| | | }; |
| | | |
| | | // Test LDIF. |
| | | /** Test LDIF. */ |
| | | private static final String[] TEST_LDIF = new String[] { |
| | | // Base entries. |
| | | "dn: cn=test parents,cn=config", |
| | |
| | | "" |
| | | }; |
| | | |
| | | // JNDI LDAP context. |
| | | /** JNDI LDAP context. */ |
| | | private JNDIDirContextAdaptor adaptor; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // Assert that the values of child 1 are correct. |
| | | /** Assert that the values of child 1 are correct. */ |
| | | private void assertChild1(TestChildCfg child) { |
| | | Assert.assertEquals(child.getMandatoryClassProperty(), |
| | | "org.opends.server.extensions.UserDefinedVirtualAttributeProvider"); |
| | |
| | | |
| | | |
| | | |
| | | // Assert that the values of child 2 are correct. |
| | | /** Assert that the values of child 2 are correct. */ |
| | | private void assertChild2(TestChildCfg child) { |
| | | Assert.assertEquals(child.getMandatoryClassProperty(), |
| | | "org.opends.server.extensions.UserDefinedVirtualAttributeProvider"); |
| | |
| | | |
| | | |
| | | |
| | | // Assert that the values of child 3 are correct. |
| | | /** Assert that the values of child 3 are correct. */ |
| | | private void assertChild3(TestChildCfg child) { |
| | | Assert.assertEquals(child.getMandatoryClassProperty(), |
| | | "org.opends.server.extensions.UserDefinedVirtualAttributeProvider"); |
| | |
| | | |
| | | |
| | | |
| | | // Assert that the values of child 4 are correct. |
| | | /** Assert that the values of child 4 are correct. */ |
| | | private void assertChild4(TestChildCfg child) { |
| | | Assert.assertEquals(child.getMandatoryClassProperty(), |
| | | "org.opends.server.extensions.UserDefinedVirtualAttributeProvider"); |
| | |
| | | |
| | | |
| | | |
| | | // 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; |
| | |
| | | |
| | | |
| | | |
| | | // Deletes the named sub-tree. |
| | | /** Deletes the named sub-tree. */ |
| | | private void deleteSubtree(String dn) throws Exception { |
| | | getAdaptor().deleteSubtree(new LdapName(dn)); |
| | | } |
| | | |
| | | |
| | | |
| | | // Gets the JNDI connection for the test server instance. |
| | | /** Gets the JNDI connection for the test server instance. */ |
| | | private synchronized JNDIDirContextAdaptor getAdaptor() throws Exception { |
| | | if (adaptor == null) { |
| | | adaptor = JNDIDirContextAdaptor.simpleSSLBind("127.0.0.1", TestCaseUtils |
| | |
| | | |
| | | |
| | | |
| | | // Gets the named parent configuration. |
| | | /** Gets the named parent configuration. */ |
| | | private TestParentCfg getParent(String name) throws IllegalArgumentException, |
| | | ConfigException { |
| | | ServerManagementContext ctx = ServerManagementContext.getInstance(); |