From 68aa678de0eb1feffaec78032cbf0fc2431a52ae Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 30 Apr 2014 14:20:36 +0000
Subject: [PATCH] Added unit tests for encoding/decoding changelog state DB entries.

---
 opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/ReplicationDB.java |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/ReplicationDB.java b/opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/ReplicationDB.java
index 1e30b8e..0200812 100644
--- a/opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/ReplicationDB.java
+++ b/opendj3-server-dev/src/server/org/opends/server/replication/server/changelog/je/ReplicationDB.java
@@ -61,7 +61,7 @@
 
 
   private Database db;
-  private ReplicationDbEnv dbenv;
+  private ReplicationDbEnv dbEnv;
   private ReplicationServer replicationServer;
   private int serverId;
   private DN baseDN;
@@ -118,22 +118,22 @@
    * @param serverId The identifier of the LDAP server.
    * @param baseDN The baseDN of the replication domain.
    * @param replicationServer The ReplicationServer that needs to be shutdown.
-   * @param dbenv The Db environment to use to create the db.
+   * @param dbEnv The Db environment to use to create the db.
    * @throws ChangelogException If a database problem happened
    */
   public ReplicationDB(int serverId, DN baseDN,
-      ReplicationServer replicationServer, ReplicationDbEnv dbenv)
+      ReplicationServer replicationServer, ReplicationDbEnv dbEnv)
       throws ChangelogException
   {
     this.serverId = serverId;
     this.baseDN = baseDN;
-    this.dbenv = dbenv;
+    this.dbEnv = dbEnv;
     this.replicationServer = replicationServer;
 
     // Get or create the associated ReplicationServerDomain and Db.
     final ReplicationServerDomain domain =
         replicationServer.getReplicationServerDomain(baseDN, true);
-    db = dbenv.getOrAddDb(serverId, baseDN, domain.getGenerationId());
+    db = dbEnv.getOrAddReplicationDB(serverId, baseDN, domain.getGenerationId());
 
     intializeCounters();
   }
@@ -649,7 +649,7 @@
 
         // Create the transaction that will protect whatever done with this
         // write cursor.
-        localTxn = dbenv.beginTransaction();
+        localTxn = dbEnv.beginTransaction();
         localCursor = db.openCursor(localTxn, null);
 
         txn = localTxn;
@@ -701,7 +701,7 @@
         }
         catch (DatabaseException e)
         {
-          dbenv.shutdownOnException(e);
+          dbEnv.shutdownOnException(e);
         }
       }
     }
@@ -852,14 +852,14 @@
       }
 
       // Clears the reference to this serverID
-      dbenv.clearServerId(baseDN, serverId);
+      dbEnv.clearServerId(baseDN, serverId);
 
       final Database oldDb = db;
       db = null; // In case there's a failure between here and recreation.
-      dbenv.clearDb(oldDb);
+      dbEnv.clearDb(oldDb);
 
       // RE-create the db
-      db = dbenv.getOrAddDb(serverId, baseDN, -1);
+      db = dbEnv.getOrAddReplicationDB(serverId, baseDN, -1);
     }
     catch (Exception e)
     {

--
Gitblit v1.10.0