From 79c2bd96a15b5cb331f6e1a58ca8838b280c8a18 Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Tue, 16 Jan 2007 09:10:31 +0000
Subject: [PATCH] This change includes a set of new unit tests dedicated to the startup phase of the synchronization server (former changelog server) and the connection phase of client LDAP server to this synchronization server. These tests cover various cases of this connection checking that the adequate changes are then sent to the client.
---
opendj-sdk/opends/src/server/org/opends/server/synchronization/changelog/ChangelogDB.java | 21 ++++++++++-----------
1 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/synchronization/changelog/ChangelogDB.java b/opendj-sdk/opends/src/server/org/opends/server/synchronization/changelog/ChangelogDB.java
index fc94e70..29e92ba 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/synchronization/changelog/ChangelogDB.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/synchronization/changelog/ChangelogDB.java
@@ -170,10 +170,6 @@
public ChangelogCursor openReadCursor(ChangeNumber changeNumber)
throws DatabaseException, Exception
{
- if (changeNumber == null)
- changeNumber = readFirstChange();
- if (changeNumber == null)
- return null;
return new ChangelogCursor(changeNumber);
}
@@ -319,13 +315,16 @@
{
cursor = db.openCursor(txn, null);
- DatabaseEntry key = new ChangelogKey(startingChangeNumber);
- DatabaseEntry data = new DatabaseEntry();
-
- if (cursor.getSearchKey(key, data, LockMode.DEFAULT) !=
- OperationStatus.SUCCESS)
+ if (startingChangeNumber != null)
{
- throw new Exception("ChangeNumber not available");
+ key = new ChangelogKey(startingChangeNumber);
+ data = new DatabaseEntry();
+
+ if (cursor.getSearchKey(key, data, LockMode.DEFAULT) !=
+ OperationStatus.SUCCESS)
+ {
+ throw new Exception("ChangeNumber not available");
+ }
}
}
@@ -373,7 +372,7 @@
}
/**
- * Get the next ChangeNumber inthe database from this Cursor.
+ * Get the next ChangeNumber in the database from this Cursor.
*
* @return The next ChangeNumber in the database from this cursor.
* @throws DatabaseException In case of underlying database problem.
--
Gitblit v1.10.0