Search in sources :

Example 1 with ExpiryPolicyFactoryConfig

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());
}
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 2 with ExpiryPolicyFactoryConfig

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());
}
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 3 with ExpiryPolicyFactoryConfig

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());
}
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 4 with ExpiryPolicyFactoryConfig

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());
}
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 5 with ExpiryPolicyFactoryConfig

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());
}
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