From 9f0904fda87bfcf921deeccdbaeafe834fbad696 Mon Sep 17 00:00:00 2001
From: Yannick Lecaillez <yannick.lecaillez@forgerock.com>
Date: Fri, 24 Apr 2015 14:30:47 +0000
Subject: [PATCH] OPENDJ-1725: Persistit: very long recovery and many discarded txns after addrate test

---
 opendj-server-legacy/src/test/java/org/opends/server/backends/LDIFBackendTestCase.java |   25 ++++++++++---------------
 1 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/opendj-server-legacy/src/test/java/org/opends/server/backends/LDIFBackendTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/backends/LDIFBackendTestCase.java
index f32c561..a8e49cd 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/backends/LDIFBackendTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/backends/LDIFBackendTestCase.java
@@ -647,31 +647,23 @@
     }
   }
 
-
-
   /**
    * Tests the {@code numSubordinates} method.
    *
    * @throws  Exception  If an unexpected problem occurs.
    */
   @Test
-  public void testNumSubordinates()
-         throws Exception
+  public void testNumSubordinates() throws Exception
   {
     Backend<?> b = getLDIFBackend();
 
-    assertEquals(b.numSubordinates(DN.valueOf("o=ldif"), false), 1);
-    assertEquals(b.numSubordinates(DN.valueOf("o=ldif"), true), 26);
-    assertEquals(b.numSubordinates(
-        DN.valueOf("uid=user.1,ou=People,o=ldif"), false), 0);
-    assertEquals(b.numSubordinates(
-        DN.valueOf("uid=user.1,ou=People,o=ldif"), true), 0);
-
+    assertEquals(b.getNumberOfChildren(DN.valueOf("o=ldif")), 1);
+    assertEquals(b.getNumberOfEntriesInBaseDN(DN.valueOf("o=ldif")), 27);
+    assertEquals(b.getNumberOfChildren(DN.valueOf("uid=user.1,ou=People,o=ldif")), 0);
     try
     {
-      b.numSubordinates(DN.valueOf("ou=nonexistent,o=ldif"), false);
-      fail("Expected an exception when calling numSubordinates on a " +
-           "non-existent entry");
+      b.getNumberOfChildren(DN.valueOf("ou=nonexistent,o=ldif"));
+      fail("Expected an exception when calling numSubordinates on a " + "non-existent entry");
     }
     catch (DirectoryException de)
     {
@@ -679,7 +671,10 @@
     }
   }
 
-
+  @Test(expectedExceptions=DirectoryException.class)
+  public void testCannotGetNumberOfEntriesForNotBaseDN() throws Exception {
+    assertEquals(getLDIFBackend().getNumberOfEntriesInBaseDN(DN.valueOf("uid=user.1,ou=People,o=ldif")), 0);
+  }
 
   /**
    * Tests LDIF export functionality.

--
Gitblit v1.10.0