From 7ef7e59d8a70949d7c07964e826c19ea882cf04c Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 06 Apr 2016 13:09:53 +0000
Subject: [PATCH] Readability: TestCaseUtils.entryFromLdifString() => TestCaseUtils.makeEntry()

---
 opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/NamingConflictTest.java |  103 ++++++++++++++++++++++++++-------------------------
 1 files changed, 52 insertions(+), 51 deletions(-)

diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/NamingConflictTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/NamingConflictTest.java
index 42b1932..902e5db 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/NamingConflictTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/NamingConflictTest.java
@@ -16,13 +16,16 @@
  */
 package org.opends.server.replication.plugin;
 
+
 import java.util.ArrayList;
 import java.util.TreeSet;
 import java.util.concurrent.atomic.AtomicBoolean;
 
+import org.forgerock.opendj.ldap.DN;
+import org.forgerock.opendj.ldap.RDN;
 import org.forgerock.opendj.ldap.ResultCode;
-import org.opends.server.TestCaseUtils;
 import org.forgerock.opendj.server.config.meta.ReplicationDomainCfgDefn.IsolationPolicy;
+import org.opends.server.TestCaseUtils;
 import org.opends.server.core.DirectoryServer;
 import org.opends.server.core.ModifyDNOperation;
 import org.opends.server.replication.ReplicationTestCase;
@@ -34,9 +37,7 @@
 import org.opends.server.replication.protocol.ModifyDNMsg;
 import org.opends.server.replication.protocol.UpdateMsg;
 import org.opends.server.types.Attribute;
-import org.forgerock.opendj.ldap.DN;
 import org.opends.server.types.Entry;
-import org.forgerock.opendj.ldap.RDN;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
@@ -196,29 +197,28 @@
 
   private Entry createAndAddEntry(String commonName) throws Exception
   {
-    Entry entry = TestCaseUtils.entryFromLdifString(
-        "dn: cn=" + commonName + ", " + TEST_ROOT_DN_STRING + "\n"
-        + "objectClass: top\n"
-        + "objectClass: person\n"
-        + "objectClass: organizationalPerson\n"
-        + "objectClass: inetOrgPerson\n"
-        + "uid: user.1\n"
-        + "description: This is the description for Aaccf Amar.\n"
-        + "st: NC\n"
-        + "postalAddress: Aaccf Amar$17984 Thirteenth Street"
-        + "$Rockford, NC  85762\n"
-        + "mail: user.1@example.com\n"
-        + "cn: Aaccf Amar\n"
-        + "l: Rockford\n"
-        + "street: 17984 Thirteenth Street\n"
-        + "employeeNumber: 1\n"
-        + "sn: Amar\n"
-        + "givenName: Aaccf\n"
-        + "postalCode: 85762\n"
-        + "userPassword: password\n"
-        + "initials: AA\n");
-    TestCaseUtils.addEntry(entry);
-    return entry;
+    // @formatter:off
+    return TestCaseUtils.addEntry(
+        "dn: cn=" + commonName + ", " + TEST_ROOT_DN_STRING,
+        "objectClass: top",
+        "objectClass: person",
+        "objectClass: organizationalPerson",
+        "objectClass: inetOrgPerson",
+        "uid: user.1",
+        "description: This is the description for Aaccf Amar.",
+        "st: NC",
+        "postalAddress: Aaccf Amar$17984 Thirteenth Street$Rockford, NC  85762",
+        "mail: user.1@example.com",
+        "cn: Aaccf Amar",
+        "l: Rockford",
+        "street: 17984 Thirteenth Street",
+        "employeeNumber: 1",
+        "sn: Amar",
+        "givenName: Aaccf",
+        "postalCode: 85762",
+        "userPassword: password",
+        "initials: AA");
+    // @formatter:on
   }
 
   /**
@@ -331,35 +331,36 @@
 
   private Entry createParentEntry() throws Exception
   {
-    return TestCaseUtils.entryFromLdifString(
-        "dn: ou=rpConflict, "+ TEST_ROOT_DN_STRING + "\n"
-        + "objectClass: top\n"
-        + "objectClass: organizationalUnit\n");
+    return TestCaseUtils.makeEntry(
+        "dn: ou=rpConflict, "+ TEST_ROOT_DN_STRING,
+        "objectClass: top",
+        "objectClass: organizationalUnit");
   }
 
   private Entry createChildEntry() throws Exception
   {
-    return TestCaseUtils.entryFromLdifString(
-        "dn: cn=child, ou=rpConflict,"+ TEST_ROOT_DN_STRING + "\n"
-        + "objectClass: top\n"
-        + "objectClass: person\n"
-        + "objectClass: organizationalPerson\n"
-        + "objectClass: inetOrgPerson\n"
-        + "uid: user.1\n"
-        + "description: This is the description for Aaccf Amar.\n"
-        + "st: NC\n"
-        + "postalAddress: Aaccf Amar$17984 Thirteenth Street"
-        + "$Rockford, NC  85762\n"
-        + "mail: user.1@example.com\n"
-        + "cn: Aaccf Amar\n"
-        + "l: Rockford\n"
-        + "street: 17984 Thirteenth Street\n"
-        + "employeeNumber: 1\n"
-        + "sn: Amar\n"
-        + "givenName: Aaccf\n"
-        + "postalCode: 85762\n"
-        + "userPassword: password\n"
-        + "initials: AA\n");
+    // @formatter:off
+    return TestCaseUtils.makeEntry(
+        "dn: cn=child, ou=rpConflict,"+ TEST_ROOT_DN_STRING,
+        "objectClass: top",
+        "objectClass: person",
+        "objectClass: organizationalPerson",
+        "objectClass: inetOrgPerson",
+        "uid: user.1",
+        "description: This is the description for Aaccf Amar.",
+        "st: NC",
+        "postalAddress: Aaccf Amar$17984 Thirteenth Street$Rockford, NC  85762",
+        "mail: user.1@example.com",
+        "cn: Aaccf Amar",
+        "l: Rockford",
+        "street: 17984 Thirteenth Street",
+        "employeeNumber: 1",
+        "sn: Amar",
+        "givenName: Aaccf",
+        "postalCode: 85762",
+        "userPassword: password",
+        "initials: AA");
+    // @formatter:on
   }
 
   private void replayMsg(UpdateMsg updateMsg) throws InterruptedException

--
Gitblit v1.10.0