Search in sources :

Example 6 with ExpiryPolicyFactoryConfig

use of com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig in project hazelcast by hazelcast.

the class TestJCache method cacheConfigXmlTest_TimedModifiedExpiryPolicyFactory.

@Test
public void cacheConfigXmlTest_TimedModifiedExpiryPolicyFactory() {
    Config config = instance1.getConfig();
    CacheSimpleConfig cacheWithTimedModifiedExpiryPolicyFactoryConfig = config.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());
}
Also used : ExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig) TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) ExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) EvictionConfig(com.hazelcast.config.EvictionConfig) Config(com.hazelcast.config.Config) TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) DurationConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) DurationConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 7 with ExpiryPolicyFactoryConfig

use of com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig in project hazelcast by hazelcast.

the class TestJCache method cacheConfigXmlTest_TimedCreatedExpiryPolicyFactory.

@Test
public void cacheConfigXmlTest_TimedCreatedExpiryPolicyFactory() {
    Config config = instance1.getConfig();
    CacheSimpleConfig cacheWithTimedCreatedExpiryPolicyFactoryConfig = config.getCacheConfig("cacheWithTimedCreatedExpiryPolicyFactory");
    ExpiryPolicyFactoryConfig expiryPolicyFactoryConfig = cacheWithTimedCreatedExpiryPolicyFactoryConfig.getExpiryPolicyFactoryConfig();
    ExpiryPolicyFactoryConfig.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());
}
Also used : ExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig) TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) ExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) EvictionConfig(com.hazelcast.config.EvictionConfig) Config(com.hazelcast.config.Config) TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) DurationConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) DurationConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 8 with ExpiryPolicyFactoryConfig

use of com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig 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());
}
Also used : TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) ExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig) TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) DurationConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig) ExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig) DurationConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 9 with ExpiryPolicyFactoryConfig

use of com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig 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());
}
Also used : TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) ExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig) TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) DurationConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig) ExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig) DurationConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 10 with ExpiryPolicyFactoryConfig

use of com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig 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());
}
Also used : TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) ExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig) TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) TimedExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig) DurationConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig) ExpiryPolicyFactoryConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig) DurationConfig(com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

ExpiryPolicyFactoryConfig (com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig)10 DurationConfig (com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig)10 TimedExpiryPolicyFactoryConfig (com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig)10 QuickTest (com.hazelcast.test.annotation.QuickTest)10 Test (org.junit.Test)10 CachePartitionLostListenerConfig (com.hazelcast.config.CachePartitionLostListenerConfig)5 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)5 Config (com.hazelcast.config.Config)5 EvictionConfig (com.hazelcast.config.EvictionConfig)5