Java Code Examples for net.sf.ehcache.CacheManager#removeAllCaches()

The following examples show how to use net.sf.ehcache.CacheManager#removeAllCaches() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProvisionedDomainAccessControlStoreTest.java    From joynr with Apache License 2.0 6 votes vote down vote up
@Test
public void testGetDomainRoles() throws Exception {
    Properties customProperties = new Properties();
    customProperties.put(StaticDomainAccessControlProvisioning.PROPERTY_PROVISIONED_DOMAIN_ROLES,
                         domainRoleEntryString);

    Injector injector = getInjector(customProperties);
    DomainAccessControlStore store = injector.getInstance(DomainAccessControlStore.class);

    assertEquals("DRE for UID1 should be the same as expectedOwnerAccessControlEntry",
                 expectedUserDomainRoleEntry,
                 store.getDomainRoles(UID1).get(0));
    assertEquals("DRE for UID1 and Role.OWNER should be the same as expectedOwnerAccessControlEntry",
                 expectedUserDomainRoleEntry,
                 store.getDomainRole(UID1, Role.OWNER));

    CacheManager cacheManager = injector.getInstance(CacheManager.class);
    cacheManager.removeAllCaches();
}
 
Example 2
Source File: ProvisionedDomainAccessControlStoreTest.java    From joynr with Apache License 2.0 6 votes vote down vote up
@Test
public void testGetMasterAce() throws Exception {
    Properties customProperties = new Properties();
    customProperties.put(StaticDomainAccessControlProvisioning.PROPERTY_PROVISIONED_MASTER_ACCESSCONTROLENTRIES,
                         masterAccessControlEntryString);

    Injector injector = getInjector(customProperties);

    DomainAccessControlStore store = injector.getInstance(DomainAccessControlStore.class);

    assertEquals("Master ACE associated to UID1 from Master ACL should be the same as expectedMasterAccessControlEntry",
                 expectedMasterAccessControlEntry,
                 store.getMasterAccessControlEntries(UID1).get(0));
    assertEquals("Master ACE associated to DOMAIN1 and INTERFACE1 should be the same as expectedMasterAccessControlEntry",
                 expectedMasterAccessControlEntry,
                 store.getMasterAccessControlEntries(DOMAIN1, INTERFACE1).get(0));
    assertEquals("Master ACE associated to UID1, DOMAIN1 and INTERFACE1 should be the same as expectedMasterAccessControlEntry",
                 expectedMasterAccessControlEntry,
                 store.getMasterAccessControlEntries(UID1, DOMAIN1, INTERFACE1).get(0));

    CacheManager cacheManager = injector.getInstance(CacheManager.class);
    cacheManager.removeAllCaches();
}