From 493420530b6f5f84ea319089836156496b4056be Mon Sep 17 00:00:00 2001
From: coulbeck <coulbeck@localhost>
Date: Thu, 12 Oct 2006 22:02:34 +0000
Subject: [PATCH] Added a test case for search operation that needs the JE backend rather than the memory backend.  There are now multiple test cases using the same JE backend, so add TestCaseUtils#clearJEBackend in those test cases to clear any existing data in the JE backend.

---
 opends/src/server/org/opends/server/backends/jeb/BackendImpl.java |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java b/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java
index c46d799..9271dc7 100644
--- a/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java
+++ b/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java
@@ -1452,4 +1452,26 @@
     assert debugEnter(CLASS_NAME, "getRootContainer");
     return rootContainer;
   }
+
+  /**
+   * Clears all the entries from the backend.  This method is for test cases
+   * that use the JE backend.
+   *
+   * @param  configEntry  The configuration entry that contains the information
+   *                      to use to initialize this backend.
+   * @param  baseDNs      The set of base DNs that have been configured for this
+   *                      backend.
+   *
+   * @throws  ConfigException  If an unrecoverable problem arises in the
+   *                           process of performing the initialization.
+   *
+   * @throws  JebException     If an error occurs while removing the data.
+   */
+  public void clearBackend(ConfigEntry configEntry, DN[] baseDNs)
+       throws ConfigException, JebException
+  {
+    Config config = new Config();
+    config.initializeConfig(configEntry, baseDNs);
+    EnvManager.removeFiles(config.getBackendDirectory().getPath());
+  }
 }

--
Gitblit v1.10.0