From 684830f9e78326aba7a0140444c0e41dcfaff809 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 25 Feb 2016 09:44:28 +0000
Subject: [PATCH] Code cleanup: - Replaced use of Socket by RemoteConnection - Replaced use of the various InternalClientConnection.processModify() methods by InternalClientConnection.processModify(ModifyRequest) everywhere it is not critical and perfs will be equivalent
---
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/IsolationTest.java | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/IsolationTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/IsolationTest.java
index 9a9e263..93cca4c 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/IsolationTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/IsolationTest.java
@@ -12,23 +12,24 @@
* information: "Portions Copyright [year] [name of copyright owner]".
*
* Copyright 2008-2009 Sun Microsystems, Inc.
- * Portions Copyright 2011-2015 ForgeRock AS.
+ * Portions Copyright 2011-2016 ForgeRock AS.
*/
package org.opends.server.replication.plugin;
+import static org.forgerock.opendj.ldap.ModificationType.*;
import static org.opends.server.TestCaseUtils.*;
+import static org.opends.server.protocols.internal.InternalClientConnection.*;
import static org.testng.Assert.*;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.forgerock.opendj.ldap.ResultCode;
import org.opends.server.TestCaseUtils;
import org.opends.server.admin.std.meta.ReplicationDomainCfgDefn.IsolationPolicy;
import org.opends.server.core.ModifyOperation;
-import org.opends.server.protocols.internal.InternalClientConnection;
import org.opends.server.replication.ReplicationTestCase;
import org.opends.server.types.DN;
-import org.forgerock.opendj.ldap.ResultCode;
import org.testng.annotations.Test;
/**
@@ -66,13 +67,8 @@
domain.start();
// check that the updates fail with the unwilling to perform error.
- InternalClientConnection conn =
- InternalClientConnection.getRootConnection();
- ModifyOperation op =
- conn.processModify(baseDn, generatemods("description", "test"));
-
- // check that the update failed.
- assertEquals(ResultCode.UNWILLING_TO_PERFORM, op.getResultCode());
+ ModifyOperation op = modify(baseDn, "description", "test");
+ assertEquals(op.getResultCode(), ResultCode.UNWILLING_TO_PERFORM);
// now configure the domain to accept changes even though it is not
// connected to any replication server.
@@ -80,7 +76,7 @@
domain.applyConfigurationChange(domainConf);
// try a new modify operation on the base entry.
- op = conn.processModify(baseDn, generatemods("description", "test"));
+ op = modify(baseDn, "description", "test");
// check that the operation was successful.
assertEquals(op.getResultCode(), ResultCode.SUCCESS,
@@ -94,4 +90,9 @@
}
}
}
+
+ private ModifyOperation modify(DN baseDn, String attrName, String attrValue)
+ {
+ return getRootConnection().processModify(modifyRequest(baseDn, REPLACE, attrName, attrValue));
+ }
}
--
Gitblit v1.10.0