From e0e6d30a905e47931a89b7e9063d752a6f28106d Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Wed, 05 Feb 2014 22:45:49 +0000
Subject: [PATCH] OPENDJ-1235: Migrate configuration framework
---
opendj-config/src/test/java/org/forgerock/opendj/config/client/ldap/AggregationClientTest.java | 23 ++++++++---------------
1 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/opendj-config/src/test/java/org/forgerock/opendj/config/client/ldap/AggregationClientTest.java b/opendj-config/src/test/java/org/forgerock/opendj/config/client/ldap/AggregationClientTest.java
index 7d07292..5835fe0 100644
--- a/opendj-config/src/test/java/org/forgerock/opendj/config/client/ldap/AggregationClientTest.java
+++ b/opendj-config/src/test/java/org/forgerock/opendj/config/client/ldap/AggregationClientTest.java
@@ -34,7 +34,6 @@
import org.forgerock.opendj.config.AdminTestCase;
import org.forgerock.opendj.config.PropertyException;
import org.forgerock.opendj.config.LDAPProfile;
-import org.forgerock.opendj.config.PropertyDefinitionsOptions;
import org.forgerock.opendj.config.TestCfg;
import org.forgerock.opendj.config.TestChildCfgClient;
import org.forgerock.opendj.config.TestChildCfgDefn;
@@ -42,8 +41,8 @@
import org.forgerock.opendj.config.client.ManagedObject;
import org.forgerock.opendj.config.client.ManagedObjectDecodingException;
import org.forgerock.opendj.config.client.ManagementContext;
+import org.forgerock.opendj.ldap.schema.Schema;
import org.forgerock.opendj.server.config.client.RootCfgClient;
-import org.opends.server.core.DirectoryServer;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
@@ -177,8 +176,7 @@
public void testAggregationEmpty() throws Exception {
MockLDAPConnection c = new MockLDAPConnection();
c.importLDIF(TEST_LDIF);
- ManagementContext ctx = LDAPManagementContext.createFromContext(c, LDAPProfile.getInstance(),
- PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
+ ManagementContext ctx = LDAPManagementContext.createFromContext(c, LDAPProfile.getInstance());
TestParentCfgClient parent = getTestParent(ctx, "test parent 1");
TestChildCfgClient child = parent.getTestChild("test child 1");
assertSetEquals(child.getAggregationProperty(), new String[0]);
@@ -195,8 +193,7 @@
public void testAggregationSingle() throws Exception {
MockLDAPConnection c = new MockLDAPConnection();
c.importLDIF(TEST_LDIF);
- ManagementContext ctx = LDAPManagementContext.createFromContext(c, LDAPProfile.getInstance(),
- PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
+ ManagementContext ctx = LDAPManagementContext.createFromContext(c, LDAPProfile.getInstance());
TestParentCfgClient parent = getTestParent(ctx, "test parent 1");
TestChildCfgClient child = parent.getTestChild("test child 2");
@@ -217,8 +214,7 @@
public void testAggregationMultiple() throws Exception {
MockLDAPConnection c = new MockLDAPConnection();
c.importLDIF(TEST_LDIF);
- ManagementContext ctx = LDAPManagementContext.createFromContext(c, LDAPProfile.getInstance(),
- PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
+ ManagementContext ctx = LDAPManagementContext.createFromContext(c, LDAPProfile.getInstance());
TestParentCfgClient parent = getTestParent(ctx, "test parent 1");
TestChildCfgClient child = parent.getTestChild("test child 3");
assertSetEquals(child.getAggregationProperty(), "LDAPS Connection Handler", "LDAP Connection Handler");
@@ -235,8 +231,7 @@
public void testAggregationBadBaseDN() throws Exception {
MockLDAPConnection c = new MockLDAPConnection();
c.importLDIF(TEST_LDIF);
- ManagementContext ctx = LDAPManagementContext.createFromContext(c, LDAPProfile.getInstance(),
- PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
+ ManagementContext ctx = LDAPManagementContext.createFromContext(c, LDAPProfile.getInstance());
TestParentCfgClient parent = getTestParent(ctx, "test parent 1");
try {
@@ -278,12 +273,11 @@
c.addExpectedAttribute("ds-cfg-rotation-policy",
"cn=LDAP Connection Handler,cn=connection handlers, cn=config");
- ManagementContext ctx = LDAPManagementContext.createFromContext(c, LDAPProfile.getInstance(),
- PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
+ ManagementContext ctx = LDAPManagementContext.createFromContext(c, LDAPProfile.getInstance());
TestParentCfgClient parent = getTestParent(ctx, "test parent 1");
TestChildCfgClient child = parent.createTestChild(TestChildCfgDefn.getInstance(), "test child new", null);
child.setMandatoryBooleanProperty(true);
- child.setMandatoryReadOnlyAttributeTypeProperty(DirectoryServer.getAttributeType("description"));
+ child.setMandatoryReadOnlyAttributeTypeProperty(Schema.getDefaultSchema().getAttributeType("description"));
child.setAggregationProperty(Collections.singleton("LDAP Connection Handler"));
child.commit();
@@ -305,8 +299,7 @@
c.addExpectedModification("ds-cfg-rotation-policy",
"cn=HTTP Connection Handler,cn=connection handlers, cn=config",
"cn=JMX Connection Handler,cn=connection handlers, cn=config");
- ManagementContext ctx = LDAPManagementContext.createFromContext(c, LDAPProfile.getInstance(),
- PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
+ ManagementContext ctx = LDAPManagementContext.createFromContext(c, LDAPProfile.getInstance());
TestParentCfgClient parent = getTestParent(ctx, "test parent 1");
TestChildCfgClient child = parent.getTestChild("test child 2");
child.setAggregationProperty(Arrays.asList("JMX Connection Handler", "HTTP Connection Handler"));
--
Gitblit v1.10.0