use of com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig in project hazelcast by hazelcast.
the class CacheConfigTest method cacheConfigXmlTest_TimedModifiedExpiryPolicyFactory.
@Test
public void cacheConfigXmlTest_TimedModifiedExpiryPolicyFactory() throws IOException {
Config config1 = new XmlConfigBuilder(configUrl1).build();
CacheSimpleConfig cacheWithTimedModifiedExpiryPolicyFactoryConfig = config1.getCacheConfig("cacheWithTimedModifiedExpiryPolicyFactory");
ExpiryPolicyFactoryConfig expiryPolicyFactoryConfig = cacheWithTimedModifiedExpiryPolicyFactoryConfig.getExpiryPolicyFactoryConfig();
TimedExpiryPolicyFactoryConfig timedExpiryPolicyFactoryConfig = expiryPolicyFactoryConfig.getTimedExpiryPolicyFactoryConfig();
DurationConfig durationConfig = timedExpiryPolicyFactoryConfig.getDurationConfig();
assertNotNull(expiryPolicyFactoryConfig);
assertNotNull(timedExpiryPolicyFactoryConfig);
assertNotNull(durationConfig);
assertNull(expiryPolicyFactoryConfig.getClassName());
assertEquals(ExpiryPolicyType.MODIFIED, timedExpiryPolicyFactoryConfig.getExpiryPolicyType());
assertEquals(3, durationConfig.getDurationAmount());
assertEquals(TimeUnit.MINUTES, durationConfig.getTimeUnit());
}
use of com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig in project hazelcast by hazelcast.
the class CacheConfigTest method cacheConfigXmlTest_TimedEternalTouchedPolicyFactory.
@Test
public void cacheConfigXmlTest_TimedEternalTouchedPolicyFactory() throws IOException {
Config config1 = new XmlConfigBuilder(configUrl1).build();
CacheSimpleConfig cacheWithTimedEternalExpiryPolicyFactoryConfig = config1.getCacheConfig("cacheWithTimedEternalExpiryPolicyFactory");
ExpiryPolicyFactoryConfig expiryPolicyFactoryConfig = cacheWithTimedEternalExpiryPolicyFactoryConfig.getExpiryPolicyFactoryConfig();
TimedExpiryPolicyFactoryConfig timedExpiryPolicyFactoryConfig = expiryPolicyFactoryConfig.getTimedExpiryPolicyFactoryConfig();
DurationConfig durationConfig = timedExpiryPolicyFactoryConfig.getDurationConfig();
assertNotNull(expiryPolicyFactoryConfig);
assertNotNull(timedExpiryPolicyFactoryConfig);
assertNull(durationConfig);
assertNull(expiryPolicyFactoryConfig.getClassName());
assertEquals(ExpiryPolicyType.ETERNAL, timedExpiryPolicyFactoryConfig.getExpiryPolicyType());
}
use of com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig in project hazelcast by hazelcast.
the class CacheConfigTest method cacheConfigXmlTest_TimedCreatedExpiryPolicyFactory.
@Test
public void cacheConfigXmlTest_TimedCreatedExpiryPolicyFactory() throws IOException {
Config config1 = new XmlConfigBuilder(configUrl1).build();
CacheSimpleConfig cacheWithTimedCreatedExpiryPolicyFactoryConfig = config1.getCacheConfig("cacheWithTimedCreatedExpiryPolicyFactory");
ExpiryPolicyFactoryConfig expiryPolicyFactoryConfig = cacheWithTimedCreatedExpiryPolicyFactoryConfig.getExpiryPolicyFactoryConfig();
TimedExpiryPolicyFactoryConfig timedExpiryPolicyFactoryConfig = expiryPolicyFactoryConfig.getTimedExpiryPolicyFactoryConfig();
DurationConfig durationConfig = timedExpiryPolicyFactoryConfig.getDurationConfig();
assertNotNull(expiryPolicyFactoryConfig);
assertNotNull(timedExpiryPolicyFactoryConfig);
assertNotNull(durationConfig);
assertNull(expiryPolicyFactoryConfig.getClassName());
assertEquals(ExpiryPolicyType.CREATED, timedExpiryPolicyFactoryConfig.getExpiryPolicyType());
assertEquals(1, durationConfig.getDurationAmount());
assertEquals(TimeUnit.DAYS, durationConfig.getTimeUnit());
}
Aggregations