명예 Hazelcast합니까 : http://docs.hazelcast.org/docs/3.6/manual/html-single/index.html#icache-configuration은 "기본"이라는 이름의 캐시에 대한 몇 가지 간단한 참조가있는 hazelcast 문서에서 기본 캐시 구성
캐시가 생성 될 때 상속되는 "기본"설정을 구성 할 수 있습니다. 통과
<cache name="default">
<statistics-enabled>true</statistics-enabled>
<management-enabled>true</management-enabled>
<expiry-policy-factory>
<timed-expiry-policy-factory expiry-policy-type="ACCESSED" time-unit="MINUTES" duration-amount="2"/>
</expiry-policy-factory>
</cache>
나는 다음과 같은 시험 싶습니다 :
@Test
public void defaultCacheSettingsTest() throws Exception {
CacheManager cacheManager = underTest.get();
Cache cache = cacheManager.createCache("foo", new MutableConfiguration<>());
CompleteConfiguration cacheConfig = (CompleteConfiguration) cache.getConfiguration(CompleteConfiguration.class);
assertThat(cacheConfig.isManagementEnabled(), is(true));
assertThat(cacheConfig.isStatisticsEnabled(), is(true));
assertThat(cacheConfig.getExpiryPolicyFactory(),
is(AccessedExpiryPolicy.factoryOf(new Duration(TimeUnit.MINUTES, 2l)))
);
}
으로 Ehcache는 "템플릿"메커니즘을 가지고 있으며, 나는이를 얻을 수 바라고 예를 들어, 다음과 같은 구성 조각을 주어 비슷한 행동.