mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

neil_a_wilson
28.43.2007 73dd9bc58413442f19cdff6a450b1a1ae167c270
opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java
@@ -48,6 +48,8 @@
import org.opends.server.backends.MemoryBackend;
import org.opends.server.backends.jeb.BackendImpl;
import org.opends.server.backends.jeb.EntryContainer;
import org.opends.server.backends.jeb.RootContainer;
import org.opends.server.config.ConfigException;
import org.opends.server.core.AddOperation;
import org.opends.server.core.DirectoryServer;
@@ -469,32 +471,13 @@
       throws Exception
  {
    BackendImpl backend = (BackendImpl)DirectoryServer.getBackend(beID);
    TaskUtils.disableBackend(beID);
    try
    RootContainer rootContainer = backend.getRootContainer();
    for (EntryContainer ec : rootContainer.getEntryContainers())
    {
      String lockFile = LockFileManager.getBackendLockFileName(backend);
      StringBuilder failureReason = new StringBuilder();
      if (!LockFileManager.acquireExclusiveLock(lockFile, failureReason))
      {
        throw new RuntimeException(failureReason.toString());
      }
      try
      {
        backend.clearBackend();
      }
      finally
      {
        LockFileManager.releaseLock(lockFile, failureReason);
      }
      ec.clear();
      assertEquals(ec.getHighestEntryID().longValue(), 0L);
    }
    finally
    {
      TaskUtils.enableBackend(beID);
    }
    rootContainer.resetNextEntryID();
    if (createBaseEntry)
    {