From 7d597d03e609ee336a75f21f330191eda77ba00d Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 04 Feb 2016 16:43:42 +0000
Subject: [PATCH] SubentryManagerTestCase.java: replace RawModification by Modification
---
opendj-server-legacy/src/test/java/org/opends/server/core/SubentryManagerTestCase.java | 25 ++++++++-----------------
1 files changed, 8 insertions(+), 17 deletions(-)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/SubentryManagerTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/SubentryManagerTestCase.java
index 76cacd5..3ba3ee2 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/SubentryManagerTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/SubentryManagerTestCase.java
@@ -28,7 +28,6 @@
package org.opends.server.core;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
import org.forgerock.opendj.ldap.ByteString;
@@ -37,18 +36,16 @@
import org.forgerock.opendj.ldap.SearchScope;
import org.forgerock.opendj.ldap.schema.AttributeType;
import org.opends.server.TestCaseUtils;
-import org.opends.server.protocols.internal.InternalClientConnection;
import org.opends.server.protocols.internal.InternalSearchOperation;
import org.opends.server.protocols.internal.SearchRequest;
-import org.opends.server.protocols.ldap.LDAPAttribute;
-import org.opends.server.protocols.ldap.LDAPModification;
import org.opends.server.tools.LDAPDelete;
import org.opends.server.tools.LDAPModify;
import org.opends.server.types.Attribute;
+import org.opends.server.types.Attributes;
import org.opends.server.types.DN;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.Entry;
-import org.opends.server.types.RawModification;
+import org.opends.server.types.Modification;
import org.opends.server.types.SubEntry;
import org.opends.server.types.SubtreeSpecification;
import org.opends.server.util.StaticUtils;
@@ -401,27 +398,21 @@
private void deleteAttribute(Entry e, String attrType)
{
- InternalClientConnection conn = getRootConnection();
- List<RawModification> mods = newRawModifications(DELETE, attrType);
- ModifyOperation modifyOperation = conn.processModify(ByteString.valueOfUtf8(e.getName().toString()), mods);
+ List<Modification> mods = newModifications(DELETE, attrType);
+ ModifyOperation modifyOperation = getRootConnection().processModify(e.getName(), mods);
assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
}
private void replaceAttribute(Entry e, String attrType, String newValue)
{
- InternalClientConnection conn = getRootConnection();
- List<RawModification> mods = newRawModifications(REPLACE, attrType, newValue);
- ModifyOperation modifyOperation = conn.processModify(ByteString.valueOfUtf8(e.getName().toString()), mods);
+ List<Modification> mods = newModifications(REPLACE, attrType, newValue);
+ ModifyOperation modifyOperation = getRootConnection().processModify(e.getName(), mods);
assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
}
-
-
- private List<RawModification> newRawModifications(ModificationType modType,
- String attrType, String... values)
+ private List<Modification> newModifications(ModificationType modType, String attrType, String... values)
{
- LDAPAttribute attr = new LDAPAttribute(attrType, Arrays.asList(values));
- return newArrayList((RawModification) new LDAPModification(modType, attr));
+ return newArrayList(new Modification(modType, Attributes.create(attrType, values)));
}
@Test
--
Gitblit v1.10.0