From 51b2d1c871e51efa30a8f419718d08be9be19f01 Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Thu, 27 May 2010 14:37:37 +0000
Subject: [PATCH] Fix issue #4537, naming changelog entries with changeNumber instead of cn. Improve ECL and tests as well

---
 opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ExternalChangeLogTest.java |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ExternalChangeLogTest.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ExternalChangeLogTest.java
index b15b2ba..6e0dfc4 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ExternalChangeLogTest.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ExternalChangeLogTest.java
@@ -1575,7 +1575,7 @@
           {
             // check the DEL entry has the right content
             assertTrue(resultEntry.getDN().toNormalizedString().equalsIgnoreCase(
-                "cn=" + cn1 + "," + TEST_ROOT_DN_STRING + ",cn=changelog"));
+                "replicationcsn=" + cn1 + "," + TEST_ROOT_DN_STRING + ",cn=changelog"));
             checkValue(resultEntry,"replicationcsn",cn1.toString());
             checkValue(resultEntry,"replicaidentifier","1201");
             checkValue(resultEntry,"targetdn","uid="+tn+"1," + TEST_ROOT_DN_STRING);
@@ -1587,7 +1587,7 @@
           {
             // check the ADD entry has the right content
             assertTrue(resultEntry.getDN().toNormalizedString().equalsIgnoreCase(
-                "cn=" + cn2 + "," + TEST_ROOT_DN_STRING + ",cn=changelog"));
+                "replicationcsn=" + cn2 + "," + TEST_ROOT_DN_STRING + ",cn=changelog"));
             String expectedValue1 = "objectClass: domain\nobjectClass: top\n" +
             "entryUUID: 11111111-1111-1111-1111-111111111111\n\n";
             String expectedValue2 = "entryUUID: 11111111-1111-1111-1111-111111111111\n" +
@@ -1604,7 +1604,7 @@
           {
             // check the MOD entry has the right content
             assertTrue(resultEntry.getDN().toNormalizedString().equalsIgnoreCase(
-                "cn=" + cn3 + "," + TEST_ROOT_DN_STRING + ",cn=changelog"));
+                "replicationcsn=" + cn3 + "," + TEST_ROOT_DN_STRING + ",cn=changelog"));
             String expectedValue = "replace: description\n" +
             "description: new value\n-\n";
             checkValue(resultEntry,"changes",expectedValue);
@@ -1619,7 +1619,7 @@
           {
             // check the MODDN entry has the right content
             assertTrue(resultEntry.getDN().toNormalizedString().equalsIgnoreCase(
-                "cn=" + cn4 + "," + TEST_ROOT_DN_STRING + ",cn=changelog"));
+                "replicationcsn=" + cn4 + "," + TEST_ROOT_DN_STRING + ",cn=changelog"));
             checkValue(resultEntry,"replicationcsn",cn4.toString());
             checkValue(resultEntry,"replicaidentifier","1201");
             checkValue(resultEntry,"targetdn","uid="+tn+"4," + TEST_ROOT_DN_STRING);
@@ -2987,9 +2987,9 @@
           {
             // check the DEL entry has the right content
             assertTrue(resultEntry.getDN().toNormalizedString().equalsIgnoreCase(
-                "cn="+String.valueOf(firstDraftChangeNumber+0)+",cn=changelog"),
+                "changenumber="+String.valueOf(firstDraftChangeNumber+0)+",cn=changelog"),
                 "Result entry DN : actual=" + resultEntry.getDN().toNormalizedString() +
-                " expected=" + "cn="+String.valueOf(firstDraftChangeNumber+0)+",cn=changelog");
+                " expected=" + "changenumber="+String.valueOf(firstDraftChangeNumber+0)+",cn=changelog");
             checkValue(resultEntry,"replicationcsn",cn1.toString());
             checkValue(resultEntry,"replicaidentifier","1201");
             checkValue(resultEntry,"targetdn","uid="+tn+"1," + TEST_ROOT_DN_STRING);
@@ -3002,7 +3002,7 @@
           {
             // check the ADD entry has the right content
             assertTrue(resultEntry.getDN().toNormalizedString().equalsIgnoreCase(
-                "cn="+String.valueOf(firstDraftChangeNumber+1)+",cn=changelog"));
+                "changenumber="+String.valueOf(firstDraftChangeNumber+1)+",cn=changelog"));
             String expectedValue1 = "objectClass: domain\nobjectClass: top\n" +
             "entryUUID: "+user1entryUUID+"\n\n";
             String expectedValue2 = "entryUUID: "+user1entryUUID+"\n" +
@@ -3019,7 +3019,7 @@
           {
             // check the MOD entry has the right content
             assertTrue(resultEntry.getDN().toNormalizedString().equalsIgnoreCase(
-                "cn="+String.valueOf(firstDraftChangeNumber+2)+",cn=changelog"));
+                "changenumber="+String.valueOf(firstDraftChangeNumber+2)+",cn=changelog"));
             String expectedValue = "replace: description\n" +
             "description: new value\n-\n";
             checkValue(resultEntry,"changes",expectedValue);
@@ -3034,7 +3034,7 @@
           {
             // check the MODDN entry has the right content
             assertTrue(resultEntry.getDN().toNormalizedString().equalsIgnoreCase(
-                "cn="+String.valueOf(firstDraftChangeNumber+3)+",cn=changelog"));
+                "changenumber="+String.valueOf(firstDraftChangeNumber+3)+",cn=changelog"));
             checkValue(resultEntry,"replicationcsn",cn4.toString());
             checkValue(resultEntry,"replicaidentifier","1201");
             checkValue(resultEntry,"targetdn","uid="+tn+"4," + TEST_ROOT_DN_STRING);
@@ -3082,7 +3082,7 @@
           {
             // check the DEL entry has the right content
             assertTrue(resultEntry.getDN().toNormalizedString().equalsIgnoreCase(
-                "cn="+String.valueOf(firstDraftChangeNumber+0)+",cn=changelog"));
+                "changenumber="+String.valueOf(firstDraftChangeNumber+0)+",cn=changelog"));
             checkValue(resultEntry,"replicationcsn",cn1.toString());
             checkValue(resultEntry,"replicaidentifier","1201");
             checkValue(resultEntry,"targetdn","uid="+tn+"1," + TEST_ROOT_DN_STRING);
@@ -3095,7 +3095,7 @@
           {
             // check the ADD entry has the right content
             assertTrue(resultEntry.getDN().toNormalizedString().equalsIgnoreCase(
-                "cn="+String.valueOf(firstDraftChangeNumber+1)+",cn=changelog"));
+                "changenumber="+String.valueOf(firstDraftChangeNumber+1)+",cn=changelog"));
             String expectedValue1 = "objectClass: domain\nobjectClass: top\n" +
             "entryUUID: "+user1entryUUID+"\n\n";
             String expectedValue2 = "entryUUID: "+user1entryUUID+"\n" +
@@ -3112,7 +3112,7 @@
           {
             // check the MOD entry has the right content
             assertTrue(resultEntry.getDN().toNormalizedString().equalsIgnoreCase(
-                "cn="+String.valueOf(firstDraftChangeNumber+2)+",cn=changelog"));
+                "changenumber="+String.valueOf(firstDraftChangeNumber+2)+",cn=changelog"));
             String expectedValue = "replace: description\n" +
             "description: new value\n-\n";
             checkValue(resultEntry,"changes",expectedValue);
@@ -3127,7 +3127,7 @@
           {
             // check the MODDN entry has the right content
             assertTrue(resultEntry.getDN().toNormalizedString().equalsIgnoreCase(
-                "cn="+String.valueOf(firstDraftChangeNumber+3)+",cn=changelog"));
+                "changenumber="+String.valueOf(firstDraftChangeNumber+3)+",cn=changelog"));
             checkValue(resultEntry,"replicationcsn",cn4.toString());
             checkValue(resultEntry,"replicaidentifier","1201");
             checkValue(resultEntry,"targetdn","uid="+tn+"4," + TEST_ROOT_DN_STRING);
@@ -3201,7 +3201,7 @@
           ldifWriter.writeEntry(resultEntry);
           // check the entry has the right content
           assertTrue(resultEntry.getDN().toNormalizedString().equalsIgnoreCase(
-              "cn=6,cn=changelog"));
+              "changenumber=6,cn=changelog"));
           checkValue(resultEntry,"replicationcsn",gblCN.toString());
           checkValue(resultEntry,"replicaidentifier","1201");
           checkValue(resultEntry,"changetype","add");

--
Gitblit v1.10.0