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

Yannick Lecaillez
29.58.2015 b88a555f5a584c355442ee8db6d218c9fe95fa36
opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/ID2ChildrenCountTest.java
File was renamed from opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/ID2CountTest.java
@@ -57,18 +57,17 @@
import org.opends.server.extensions.DiskSpaceMonitor;
import org.opends.server.types.DN;
import org.opends.server.types.DirectoryException;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@Test(groups = { "precommit", "pluggablebackend" }, sequential = true)
public class ID2CountTest extends DirectoryServerTestCase
public class ID2ChildrenCountTest extends DirectoryServerTestCase
{
  private final TreeName id2CountTreeName = new TreeName("base-dn", "index-id");
  private ExecutorService parallelExecutor;
  private ID2Count id2Count;
  private ID2ChildrenCount id2ChildrenCount;
  private PDBStorage storage;
  @BeforeClass
@@ -95,7 +94,7 @@
      }
    });
    id2Count = new ID2Count(id2CountTreeName);
    id2ChildrenCount = new ID2ChildrenCount(id2CountTreeName);
    parallelExecutor = Executors.newFixedThreadPool(32);
  }
@@ -186,8 +185,8 @@
      @Override
      public void run(WriteableTransaction txn) throws Exception
      {
        final long delta = id2Count.removeCount(txn, key);
        id2Count.updateTotalCount(txn, -delta);
        final long delta = id2ChildrenCount.removeCount(txn, key);
        id2ChildrenCount.updateTotalCount(txn, -delta);
        l.handleResult(delta);
      }
    });
@@ -200,8 +199,8 @@
      @Override
      public void run(WriteableTransaction txn) throws Exception
      {
        id2Count.updateCount(txn, key, delta);
        id2Count.updateTotalCount(txn, delta);
        id2ChildrenCount.updateCount(txn, key, delta);
        id2ChildrenCount.updateTotalCount(txn, delta);
      }
    });
  }
@@ -212,7 +211,7 @@
      @Override
      public Long run(ReadableTransaction txn) throws Exception
      {
        return id2Count.getCount(txn, key);
        return id2ChildrenCount.getCount(txn, key);
      }
    });
  }
@@ -223,7 +222,7 @@
      @Override
      public Long run(ReadableTransaction txn) throws Exception
      {
        return id2Count.getTotalCount(txn);
        return id2ChildrenCount.getTotalCount(txn);
      }
    });
  }