| | |
| | | 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; |
| | |
| | | |
| | | @BeforeClass |
| | | public void startServer() throws Exception { |
| | | TestCaseUtils.startServer(); |
| | | TestCaseUtils.startFakeServer(); |
| | | } |
| | | |
| | | @AfterClass |
| | | public void stopServer() throws Exception { |
| | | TestCaseUtils.shutdownFakeServer(); |
| | | } |
| | | |
| | | @BeforeMethod |
| | |
| | | |
| | | 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(); |
| | |
| | | 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" }); |