/** * Ensure that a {@link MutableConfiguration} correctly uses the defaults * from an implementation of the base Configuration interface. */ @Test public void testValidateFromBasicConfigurationRetrievedFromCache() { Cache<String, Integer> cache = getCacheManager().createCache("basicCache", new MutableBasicConfiguration()); CompleteConfiguration configuration = cache.getConfiguration(CompleteConfiguration.class); validateDefaults(configuration); }
/** * Ensure a cache's config isn't changed by its configuration object after construction. */ @Test public void testModifyingConfigurationAfterCreateCacheDoesNotModifyCacheConfiguration() { MutableBasicConfiguration mutableConfiguration = new MutableBasicConfiguration().setTypes(Integer.class, Integer.class); Cache<Object, Object> cache = getCacheManager().createCache(getTestCacheName() + "_", mutableConfiguration); mutableConfiguration.setTypes(String.class, String.class); assertEquals(Integer.class, cache.getConfiguration(Configuration.class).getKeyType()); assertEquals(Integer.class, cache.getConfiguration(Configuration.class).getValueType()); }