From 0bd0fe4197cc72c8fed4d520d043d618b2ff9301 Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Fri, 27 Apr 2007 07:09:14 +0000
Subject: [PATCH] This is is the last part of the replication renaming (issue 1090) and is the renaming of the configuration.
---
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java | 29 +++++++++++++++++++----------
1 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java
index a6e17ac..af0d948 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java
@@ -46,6 +46,7 @@
import org.testng.annotations.BeforeClass;
import static org.testng.Assert.assertEquals;
+import java.net.ServerSocket;
import java.util.List;
import java.util.ArrayList;
@@ -55,6 +56,8 @@
public class HistoricalTest
extends ReplicationTestCase
{
+ private int replServerPort;
+
/**
* Set up replication on the test backend.
* @throws Exception If an error occurs.
@@ -68,24 +71,30 @@
// Create an internal connection.
connection = InternalClientConnection.getRootConnection();
+
+ // find a free port for the replicationServer
+ ServerSocket socket = TestCaseUtils.bindFreePort();
+ replServerPort = socket.getLocalPort();
+ socket.close();
// The replication server.
- String changeLogStringDN = "cn=Changelog Server, " + synchroPluginStringDN;
- String changeLogLdif = "dn: " + changeLogStringDN + "\n"
+ String replServerStringDN = "cn=Replication Server, " + synchroPluginStringDN;
+ String replServerLdif = "dn: " + replServerStringDN + "\n"
+ "objectClass: top\n"
- + "objectClass: ds-cfg-synchronization-changelog-server-config\n"
- + "cn: Changelog Server\n" + "ds-cfg-changelog-port: 8989\n"
- + "ds-cfg-changelog-server-id: 1\n";
- changeLogEntry = TestCaseUtils.entryFromLdifString(changeLogLdif);
+ + "objectClass: ds-cfg-replication-server-config\n"
+ + "cn: replication Server\n"
+ + "ds-cfg-replication-server-port: " + replServerPort + "\n"
+ + "ds-cfg-replication-server-id: 1\n";
+ replServerEntry = TestCaseUtils.entryFromLdifString(replServerLdif);
// The suffix to be synchronized.
String synchroServerStringDN = "o=test, cn=domains, " + synchroPluginStringDN;
String synchroServerLdif = "dn: " + synchroServerStringDN + "\n"
+ "objectClass: top\n"
- + "objectClass: ds-cfg-synchronization-provider-config\n"
+ + "objectClass: ds-cfg-replication-domain-config\n"
+ "cn: example\n"
- + "ds-cfg-synchronization-dn: o=test\n"
- + "ds-cfg-changelog-server: localhost:8989\n"
+ + "ds-cfg-replication-dn: o=test\n"
+ + "ds-cfg-replication-server: localhost:" + replServerPort + "\n"
+ "ds-cfg-directory-server-id: 1\n"
+ "ds-cfg-receive-status: true\n";
synchroServerEntry = TestCaseUtils.entryFromLdifString(synchroServerLdif);
@@ -203,7 +212,7 @@
* This must use a different serverId to that of the directory server.
*/
ReplicationBroker broker =
- openChangelogSession(baseDn, (short) 2, 100, 8989, 1000, true);
+ openReplicationSession(baseDn, (short)2, 100, replServerPort, 1000, true);
// Clear the backend.
--
Gitblit v1.10.0