| | |
| | | import org.opends.server.admin.server.AdminTestCaseUtils; |
| | | import org.testng.annotations.BeforeClass; |
| | | import org.opends.server.admin.std.meta.*; |
| | | import org.opends.server.admin.std.server.FileSystemEntryCacheCfg; |
| | | import org.opends.server.api.Backend; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.types.Attribute; |
| | |
| | | |
| | | |
| | | /** |
| | | * Temporary folder to setup dummy JE backend environment in. |
| | | */ |
| | | private static File jeBackendTempDir; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Utility method to restore default cache configuration. |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | |
| | | throws Exception |
| | | { |
| | | // Make sure JE directory exist. |
| | | File tempDir = TestCaseUtils.createTemporaryDirectory("db-cachetest"); |
| | | String jeDir = tempDir.getAbsolutePath(); |
| | | jeBackendTempDir = TestCaseUtils.createTemporaryDirectory("db-cachetest"); |
| | | String jeDir = jeBackendTempDir.getAbsolutePath(); |
| | | |
| | | // Create dummy JE backend for this test. |
| | | TestCaseUtils.dsconfig("create-backend", "--backend-name", "cacheTest", |
| | |
| | | private void persistentCacheTeardown() |
| | | throws Exception |
| | | { |
| | | File tempDir = TestCaseUtils.createTemporaryDirectory("db-cachetest"); |
| | | |
| | | // Dummy JE backend cleanup. |
| | | TestCaseUtils.dsconfig("delete-backend", "--backend-name", "cacheTest"); |
| | | TestCaseUtils.deleteDirectory(tempDir); |
| | | TestCaseUtils.deleteDirectory(jeBackendTempDir); |
| | | |
| | | // Configure this cache back to defaults. |
| | | restoreCacheDefaults(); |
| | |
| | | throws Exception |
| | | { |
| | | super.cache.finalizeEntryCache(); |
| | | |
| | | // Remove default FS cache JE environment. |
| | | FileSystemEntryCacheCfg config = |
| | | (FileSystemEntryCacheCfg) super.configuration; |
| | | TestCaseUtils.deleteDirectory(new File(config.getCacheDirectory())); |
| | | } |
| | | |
| | | |