From 82d096b83ec89684d8a815bc3b1870c1a0157bfe Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Tue, 27 Nov 2007 07:52:20 +0000
Subject: [PATCH] Fix for 2565 Java Exception during conflict resolution In this particular case of conflict resolution, the newSuperior was null and this was causing some Exception. The solution is simply to test for this condition and generate a conflict. Also added a unit test for this particular case.
---
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/UpdateOperationTest.java | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/UpdateOperationTest.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/UpdateOperationTest.java
index 9608f6c..58395af 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/UpdateOperationTest.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/UpdateOperationTest.java
@@ -1191,6 +1191,37 @@
assertEquals(DummyAlertHandler.getAlertCount(), AlertCount,
"An alert was incorrectly generated when resolving conflicts");
+ /*
+ * Check that a conflict is detected when an entry is
+ * moved below an entry that does not exist.
+ */
+ updateMonitorCount(baseDn, unresolvedMonitorAttr);
+ AlertCount = DummyAlertHandler.getAlertCount();
+ modDnMsg = new ModifyDNMsg(
+ "uid=new person,ou=People,dc=example,dc=com", gen.newChangeNumber(),
+ "33333333-3333-3333-3333-333333333333",
+ "12343333-3533-3633-3333-333333833333" , false,
+ "uid=wrong, ou=people,dc=example,dc=com",
+ "uid=newrdn");
+ broker.publish(modDnMsg);
+
+ count = 0;
+ while ((count<2000) && getMonitorDelta() == 0)
+ {
+ // it is possible that the update has not yet been applied
+ // wait a short time and try again.
+ Thread.sleep(100);
+ count++;
+ }
+ // if the monitor counter did not get incremented after 200sec
+ // then something got wrong.
+ assertTrue(count < 200);
+
+ // check that the entry have been correctly marked as conflicting.
+ assertTrue(checkEntryHasAttribute(
+ DN.decode("uid=new person,ou=baseDn2,"+baseDn),
+ ReplicationDomain.DS_SYNC_CONFLICT,
+ "uid=newrdn,ou=People,dc=example,dc=com", 1000, true));
broker.stop();
}
--
Gitblit v1.10.0