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/pluggable/StateTest.java |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/StateTest.java b/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/StateTest.java
index f97d9a7..345194e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/StateTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/StateTest.java
@@ -50,6 +50,7 @@
 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;
@@ -67,7 +68,12 @@
 
   @BeforeClass
   public void startServer() throws Exception {
-    TestCaseUtils.startServer();
+    TestCaseUtils.startFakeServer();
+  }
+
+  @AfterClass
+  public void stopServer() throws Exception {
+    TestCaseUtils.shutdownFakeServer();
   }
 
   @BeforeMethod
@@ -77,7 +83,7 @@
 
     ServerContext serverContext = mock(ServerContext.class);
     when(serverContext.getMemoryQuota()).thenReturn(new MemoryQuota());
-    when(serverContext.getDiskSpaceMonitor()).thenReturn(new DiskSpaceMonitor());
+    when(serverContext.getDiskSpaceMonitor()).thenReturn(mock(DiskSpaceMonitor.class));
 
     storage = new PersistItStorage(createBackendCfg(), serverContext);
     org.opends.server.backends.pluggable.spi.Importer importer = storage.startImport();
@@ -180,7 +186,6 @@
     when(backendCfg.getDBDirectoryPermissions()).thenReturn("755");
     when(backendCfg.getDBCacheSize()).thenReturn(0L);
     when(backendCfg.getDBCachePercent()).thenReturn(20);
-    when(backendCfg.isSubordinateIndexesEnabled()).thenReturn(true);
     when(backendCfg.getBaseDN()).thenReturn(TestCaseUtils.newSortedSet(DN.valueOf("dc=test,dc=com")));
     when(backendCfg.dn()).thenReturn(DN.valueOf("dc=test,dc=com"));
     when(backendCfg.listBackendIndexes()).thenReturn(new String[] { "sn" });

--
Gitblit v1.10.0