From 36050c5587e30c0e0b740166c73c2d145c3471d1 Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Wed, 30 Apr 2008 23:38:25 +0000
Subject: [PATCH] Fix for issue where deleteing the last few entries indexed by a VLV index might cause a NPE.

---
 opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java
index 10ad394..1ef4ef4 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java
@@ -72,6 +72,7 @@
 import org.opends.server.config.ConfigException;
 import org.opends.server.core.AddOperation;
 import org.opends.server.core.DirectoryServer;
+import org.opends.server.core.DeleteOperation;
 import org.opends.server.extensions.ConfigFileHandler;
 import org.opends.server.loggers.TextAccessLogPublisher;
 import org.opends.server.loggers.TextErrorLogPublisher;
@@ -1071,6 +1072,26 @@
 
 
 
+  /**
+   * Deletess the provided entry from the Directory Server using an
+   * internal operation.
+   *
+   * @param  entry  The entry to be added.
+   *
+   * @throws  Exception  If an unexpected problem occurs.
+   */
+  public static void deleteEntry(Entry entry)
+         throws Exception
+  {
+    InternalClientConnection conn =
+         InternalClientConnection.getRootConnection();
+
+    DeleteOperation deleteOperation = conn.processDelete(entry.getDN());
+    assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS);
+  }
+
+
+
   public static boolean canBind(String dn, String pw) throws Exception
   {
     // Check that the user can bind.

--
Gitblit v1.10.0