| | |
| | | import org.opends.server.TestCaseUtils; |
| | | import org.forgerock.opendj.server.config.server.EntryCacheCfg; |
| | | import org.opends.server.api.EntryCache; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.forgerock.opendj.ldap.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.util.ServerConstants; |
| | |
| | | cache.toVerboseString()); |
| | | |
| | | TestCaseUtils.initializeTestBackend(false); |
| | | String b = DirectoryServer.getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | String b = |
| | | TestCaseUtils.getServerContext().getBackendConfigManager().getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | |
| | | assertFalse(cache.containsEntry(testEntriesList.get(0).getName()), |
| | | "Not expected to find " + testEntriesList.get(0).getName() + |
| | |
| | | cache.toVerboseString()); |
| | | |
| | | TestCaseUtils.initializeTestBackend(false); |
| | | String b = DirectoryServer.getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | String b = |
| | | TestCaseUtils.getServerContext().getBackendConfigManager().getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | |
| | | assertNull(cache.getEntry(testEntriesList.get(0).getName()), |
| | | "Not expected to find " + testEntriesList.get(0).getName() + |
| | |
| | | cache.toVerboseString()); |
| | | |
| | | TestCaseUtils.initializeTestBackend(false); |
| | | String b = DirectoryServer.getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | String b = |
| | | TestCaseUtils.getServerContext().getBackendConfigManager().getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | |
| | | assertNull(cache.getEntry(testEntriesList.get(0).getName()), |
| | | "Not expected to find " + testEntriesList.get(0).getName() + |
| | |
| | | cache.toVerboseString()); |
| | | |
| | | TestCaseUtils.initializeTestBackend(false); |
| | | String b = DirectoryServer.getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | String b = |
| | | TestCaseUtils.getServerContext().getBackendConfigManager().getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | |
| | | assertNull(cache.getEntry(b, -1), |
| | | "Not expected to find entry id " + -1 + |
| | |
| | | cache.toVerboseString()); |
| | | |
| | | TestCaseUtils.initializeTestBackend(false); |
| | | String b = DirectoryServer.getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | String b = |
| | | TestCaseUtils.getServerContext().getBackendConfigManager().getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | |
| | | assertEquals(cache.getEntryID(testEntriesList.get(0).getName()), -1, |
| | | "Not expected to find " + testEntriesList.get(0).getName() + |
| | |
| | | cache.toVerboseString()); |
| | | |
| | | TestCaseUtils.initializeTestBackend(false); |
| | | String b = DirectoryServer.getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | String b = |
| | | TestCaseUtils.getServerContext().getBackendConfigManager().getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | |
| | | cache.putEntry(testEntriesList.get(0), b, 1); |
| | | |
| | |
| | | cache.toVerboseString()); |
| | | |
| | | TestCaseUtils.initializeTestBackend(false); |
| | | String b = DirectoryServer.getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | String b = |
| | | TestCaseUtils.getServerContext().getBackendConfigManager().getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | |
| | | assertTrue(cache.putEntryIfAbsent(testEntriesList.get(0), b, 1), |
| | | "Not expected to find " + testEntriesList.get(0).getName() + |
| | |
| | | cache.toVerboseString()); |
| | | |
| | | TestCaseUtils.initializeTestBackend(false); |
| | | String b = DirectoryServer.getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | String b = |
| | | TestCaseUtils.getServerContext().getBackendConfigManager().getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | |
| | | cache.removeEntry(testEntriesList.get(0).getName()); |
| | | cache.putEntry(testEntriesList.get(0), b, 1); |
| | |
| | | cache.toVerboseString()); |
| | | |
| | | TestCaseUtils.initializeTestBackend(false); |
| | | String b = DirectoryServer.getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | String b = |
| | | TestCaseUtils.getServerContext().getBackendConfigManager().getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | |
| | | cache.clear(); |
| | | cache.putEntry(testEntriesList.get(0), b, 1); |
| | |
| | | cache.toVerboseString()); |
| | | |
| | | TestCaseUtils.initializeTestBackend(false); |
| | | String b = DirectoryServer.getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | String c = DirectoryServer.getLocalBackend(DN.valueOf("cn=config")).getBackendID(); |
| | | String b = |
| | | TestCaseUtils.getServerContext().getBackendConfigManager().getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | String c = |
| | | TestCaseUtils.getServerContext().getBackendConfigManager() |
| | | .getLocalBackend(DN.valueOf("cn=config")).getBackendID(); |
| | | |
| | | cache.clearBackend(b); |
| | | cache.putEntry(testEntriesList.get(0), b, 1); |
| | |
| | | cache.toVerboseString()); |
| | | |
| | | TestCaseUtils.initializeTestBackend(false); |
| | | String b = DirectoryServer.getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | String c = DirectoryServer.getLocalBackend(DN.valueOf("cn=config")).getBackendID(); |
| | | String b = |
| | | TestCaseUtils.getServerContext().getBackendConfigManager().getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | String c = TestCaseUtils.getServerContext().getBackendConfigManager() |
| | | .getLocalBackend(DN.valueOf("cn=config")).getBackendID(); |
| | | |
| | | cache.putEntry(testEntriesList.get(0), b, 1); |
| | | Entry testEntry = testEntriesList.get(1); |
| | |
| | | public void testCacheConcurrency() |
| | | throws Exception |
| | | { |
| | | String b = DirectoryServer.getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | String b = |
| | | TestCaseUtils.getServerContext().getBackendConfigManager().getLocalBackend(DN.valueOf("o=test")).getBackendID(); |
| | | |
| | | for(int loops = 0; loops < CONCURRENCYLOOPS; loops++) { |
| | | for(int i = 0; i < NUMTESTENTRIES; i++) { |