From f85d2d244205d32a39ff5d5f52e90ce2e10fc24a Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Tue, 08 Sep 2026 07:29:00 +0000
Subject: [PATCH] [#910] Test that a ModifyDN conflict is still solved while server-error-result-code is one of the conflict codes (#938)
---
opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
index 0a2028f..a1eeb60 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
@@ -491,6 +491,28 @@
addConfigEntry(synchroServerEntry, "Unable to add the synchronized server");
}
+ /**
+ * Sets the result code this server puts on an internal error, the way an administrator
+ * would, and asserts that the change was applied.
+ * <p>
+ * The setting is server-wide, so a test which changes it owns putting it back - after
+ * a failure of its own as well, which is why the caller's tearDown() is the place for
+ * that rather than a finally in the test body: an assertion failure raised while
+ * restoring would otherwise replace the failure the test was reporting.
+ *
+ * @param resultCode the numeric result code
+ * @throws Exception if the modification could not be run at all
+ */
+ protected static void setServerErrorResultCode(int resultCode) throws Exception
+ {
+ assertEquals(TestCaseUtils.applyModifications(true,
+ "dn: cn=config",
+ "changetype: modify",
+ "replace: ds-cfg-server-error-result-code",
+ "ds-cfg-server-error-result-code: " + resultCode), 0,
+ "the server error result code could not be changed");
+ }
+
private void addConfigEntry(Entry configEntry, String errorMessage) throws Exception
{
if (configEntry != null)
--
Gitblit v1.10.0