use of com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig in project hazelcast by hazelcast.
the class TestJCache method cacheConfigXmlTest_TimedEternalTouchedPolicyFactory.
@Test
public void cacheConfigXmlTest_TimedEternalTouchedPolicyFactory() {
Config config = instance1.getConfig();
CacheSimpleConfig cacheWithTimedEternalExpiryPolicyFactoryConfig = config.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 in project hazelcast by hazelcast.
the class TestJCache method cacheConfigXmlTest_TimedModifiedTouchedPolicyFactory.
@Test
public void cacheConfigXmlTest_TimedModifiedTouchedPolicyFactory() {
Config config = instance1.getConfig();
CacheSimpleConfig cacheWithTimedTouchedExpiryPolicyFactoryConfig = config.getCacheConfig("cacheWithTimedTouchedExpiryPolicyFactory");
ExpiryPolicyFactoryConfig expiryPolicyFactoryConfig = cacheWithTimedTouchedExpiryPolicyFactoryConfig.getExpiryPolicyFactoryConfig();
TimedExpiryPolicyFactoryConfig timedExpiryPolicyFactoryConfig = expiryPolicyFactoryConfig.getTimedExpiryPolicyFactoryConfig();
DurationConfig durationConfig = timedExpiryPolicyFactoryConfig.getDurationConfig();
assertNotNull(expiryPolicyFactoryConfig);
assertNotNull(timedExpiryPolicyFactoryConfig);
assertNotNull(durationConfig);
assertNull(expiryPolicyFactoryConfig.getClassName());
assertEquals(ExpiryPolicyType.TOUCHED, timedExpiryPolicyFactoryConfig.getExpiryPolicyType());
assertEquals(4, durationConfig.getDurationAmount());
assertEquals(TimeUnit.SECONDS, durationConfig.getTimeUnit());
}
use of com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig in project hazelcast by hazelcast.
the class TestJCache method cacheConfigXmlTest_TimedAccessedExpiryPolicyFactory.
@Test
public void cacheConfigXmlTest_TimedAccessedExpiryPolicyFactory() {
Config config = instance1.getConfig();
CacheSimpleConfig cacheWithTimedAccessedExpiryPolicyFactoryConfig = config.getCacheConfig("cacheWithTimedAccessedExpiryPolicyFactory");
ExpiryPolicyFactoryConfig expiryPolicyFactoryConfig = cacheWithTimedAccessedExpiryPolicyFactoryConfig.getExpiryPolicyFactoryConfig();
TimedExpiryPolicyFactoryConfig timedExpiryPolicyFactoryConfig = expiryPolicyFactoryConfig.getTimedExpiryPolicyFactoryConfig();
DurationConfig durationConfig = timedExpiryPolicyFactoryConfig.getDurationConfig();
assertNotNull(expiryPolicyFactoryConfig);
assertNotNull(timedExpiryPolicyFactoryConfig);
assertNotNull(durationConfig);
assertNull(expiryPolicyFactoryConfig.getClassName());
assertEquals(ExpiryPolicyType.ACCESSED, timedExpiryPolicyFactoryConfig.getExpiryPolicyType());
assertEquals(2, durationConfig.getDurationAmount());
assertEquals(TimeUnit.HOURS, durationConfig.getTimeUnit());
}
use of com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig in project hazelcast by hazelcast.
the class CacheConfigTest method cacheConfigXmlTest_TimedModifiedTouchedPolicyFactory.
@Test
public void cacheConfigXmlTest_TimedModifiedTouchedPolicyFactory() throws IOException {
Config config1 = new XmlConfigBuilder(configUrl1).build();
CacheSimpleConfig cacheWithTimedTouchedExpiryPolicyFactoryConfig = config1.getCacheConfig("cacheWithTimedTouchedExpiryPolicyFactory");
ExpiryPolicyFactoryConfig expiryPolicyFactoryConfig = cacheWithTimedTouchedExpiryPolicyFactoryConfig.getExpiryPolicyFactoryConfig();
TimedExpiryPolicyFactoryConfig timedExpiryPolicyFactoryConfig = expiryPolicyFactoryConfig.getTimedExpiryPolicyFactoryConfig();
DurationConfig durationConfig = timedExpiryPolicyFactoryConfig.getDurationConfig();
assertNotNull(expiryPolicyFactoryConfig);
assertNotNull(timedExpiryPolicyFactoryConfig);
assertNotNull(durationConfig);
assertNull(expiryPolicyFactoryConfig.getClassName());
assertEquals(ExpiryPolicyType.TOUCHED, timedExpiryPolicyFactoryConfig.getExpiryPolicyType());
assertEquals(4, durationConfig.getDurationAmount());
assertEquals(TimeUnit.SECONDS, durationConfig.getTimeUnit());
}
use of com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig in project hazelcast by hazelcast.
the class CacheConfigTest method cacheConfigXmlTest_TimedAccessedExpiryPolicyFactory.
@Test
public void cacheConfigXmlTest_TimedAccessedExpiryPolicyFactory() throws IOException {
Config config1 = new XmlConfigBuilder(configUrl1).build();
CacheSimpleConfig cacheWithTimedAccessedExpiryPolicyFactoryConfig = config1.getCacheConfig("cacheWithTimedAccessedExpiryPolicyFactory");
ExpiryPolicyFactoryConfig expiryPolicyFactoryConfig = cacheWithTimedAccessedExpiryPolicyFactoryConfig.getExpiryPolicyFactoryConfig();
TimedExpiryPolicyFactoryConfig timedExpiryPolicyFactoryConfig = expiryPolicyFactoryConfig.getTimedExpiryPolicyFactoryConfig();
DurationConfig durationConfig = timedExpiryPolicyFactoryConfig.getDurationConfig();
assertNotNull(expiryPolicyFactoryConfig);
assertNotNull(timedExpiryPolicyFactoryConfig);
assertNotNull(durationConfig);
assertNull(expiryPolicyFactoryConfig.getClassName());
assertEquals(ExpiryPolicyType.ACCESSED, timedExpiryPolicyFactoryConfig.getExpiryPolicyType());
assertEquals(2, durationConfig.getDurationAmount());
assertEquals(TimeUnit.HOURS, durationConfig.getTimeUnit());
}
Aggregations