From a11a0561f324860f1381a3b57212e20ede1ad05f Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 03 Sep 2015 14:06:47 +0000
Subject: [PATCH] Fix randomness in ChangelogBackendTestCase

---
 opendj-server-legacy/src/main/java/org/opends/server/replication/common/MultiDomainServerState.java |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/common/MultiDomainServerState.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/common/MultiDomainServerState.java
index 0de1556..2edf41b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/common/MultiDomainServerState.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/common/MultiDomainServerState.java
@@ -64,13 +64,31 @@
   }
 
   /**
+   * Copy constructor.
+   *
+   * @param cookie
+   *          the cookie to copy
+   */
+  public MultiDomainServerState(MultiDomainServerState cookie)
+  {
+    list = new ConcurrentSkipListMap<>();
+
+    for (Map.Entry<DN, ServerState> mapEntry : cookie.list.entrySet())
+    {
+      DN dn = mapEntry.getKey();
+      ServerState state = mapEntry.getValue();
+      list.put(dn, state.duplicate());
+    }
+  }
+
+  /**
    * Create an object from a string representation.
-   * @param mdss The provided string representation of the state.
+   * @param cookie The provided string representation of the state.
    * @throws DirectoryException when the string has an invalid format
    */
-  public MultiDomainServerState(String mdss) throws DirectoryException
+  public MultiDomainServerState(String cookie) throws DirectoryException
   {
-    list = new ConcurrentSkipListMap<>(splitGenStateToServerStates(mdss));
+    list = new ConcurrentSkipListMap<>(splitGenStateToServerStates(cookie));
   }
 
   /**

--
Gitblit v1.10.0