Author: mircea.markus
Date: 2008-08-21 09:53:48 -0400 (Thu, 21 Aug 2008)
New Revision: 6588
Modified:
core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/LegacyConfigurationTest.java
Log:
fixed test
Modified:
core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/LegacyConfigurationTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/LegacyConfigurationTest.java 2008-08-21
13:16:49 UTC (rev 6587)
+++
core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/LegacyConfigurationTest.java 2008-08-21
13:53:48 UTC (rev 6588)
@@ -34,12 +34,7 @@
import org.jboss.cache.config.EvictionRegionConfig;
import org.jboss.cache.config.RuntimeConfig;
import org.jboss.cache.config.parsing.XmlConfigHelper;
-import org.jboss.cache.eviction.FIFOConfiguration;
-import org.jboss.cache.eviction.FIFOPolicy;
-import org.jboss.cache.eviction.LRUConfiguration;
-import org.jboss.cache.eviction.LRUPolicy;
-import org.jboss.cache.eviction.MRUConfiguration;
-import org.jboss.cache.eviction.MRUPolicy;
+import org.jboss.cache.eviction.*;
import org.jboss.cache.jmx.CacheJmxWrapper;
import org.jboss.cache.jmx.CacheJmxWrapperMBean;
import org.jboss.cache.loader.FileCacheLoader;
@@ -183,37 +178,29 @@
assertEquals("EvictionPolicyConfig",
getEvictionPolicyConfig().toString(), wrapper.getEvictionPolicyConfig().toString());
EvictionConfig ec = c.getEvictionConfig();
- assertEquals("EC queue size", 20000,
ec.getDefaultEvictionRegionConfig().getEventQueueSize());
+ assertEquals("EC queue size", 1000,
ec.getDefaultEvictionRegionConfig().getEventQueueSize());
assertEquals("EC wakeup", 5000, ec.getWakeupInterval());
- assertEquals("EC default pol", LRUPolicy.class.getName(),
ec.getDefaultEvictionPolicyClass());
+ assertEquals("EC default pol", LRUAlgorithm.class.getName(),
ec.getDefaultEvictionRegionConfig().getEvictionAlgorithmConfig().getEvictionAlgorithmClassName());
List<EvictionRegionConfig> ercs = ec.getEvictionRegionConfigs();
EvictionRegionConfig erc = ercs.get(0);
- assertEquals("ERC0 name", "/_default_", erc.getRegionName());
- assertEquals("ERC0 queue size", 1000, erc.getEventQueueSize());
- LRUConfiguration lru = (LRUConfiguration) erc.getEvictionPolicyConfig();
- assertEquals("EPC0 pol", LRUPolicy.class.getName(),
lru.getEvictionPolicyClass());
- assertEquals("EPC0 maxnodes", 5000, lru.getMaxNodes());
- assertEquals("EPC0 ttl", 1000, lru.getTimeToLiveSeconds());
- erc = ercs.get(1);
assertEquals("ERC1 name", "/org/jboss/data",
erc.getRegionName());
- assertEquals("ERC1 queue size", 20000, erc.getEventQueueSize());
- FIFOConfiguration fifo = (FIFOConfiguration) erc.getEvictionPolicyConfig();
- assertEquals("EPC1 pol", FIFOPolicy.class.getName(),
fifo.getEvictionPolicyClass());
+ assertEquals("ERC1 queue size", 1000, erc.getEventQueueSize());
+ FIFOAlgorithmConfig fifo = (FIFOAlgorithmConfig) erc.getEvictionAlgorithmConfig();
+ assertEquals("EPC1 pol", FIFOAlgorithm.class.getName(),
fifo.getEvictionAlgorithmClassName());
assertEquals("EPC1 maxnodes", 5000, fifo.getMaxNodes());
- erc = ercs.get(2);
+ erc = ercs.get(1);
assertEquals("ERC2 name", "/test", erc.getRegionName());
- assertEquals("ERC2 queue size", 20000, erc.getEventQueueSize());
- MRUConfiguration mru = (MRUConfiguration) erc.getEvictionPolicyConfig();
- assertEquals("EPC2 pol", MRUPolicy.class.getName(),
mru.getEvictionPolicyClass());
+ assertEquals("ERC2 queue size", 1000, erc.getEventQueueSize());
+ MRUAlgorithmConfig mru = (MRUAlgorithmConfig) erc.getEvictionAlgorithmConfig();
+ assertEquals("EPC2 pol", MRUAlgorithm.class.getName(),
mru.getEvictionAlgorithmClassName());
assertEquals("EPC2 maxnodes", 10000, mru.getMaxNodes());
- erc = ercs.get(3);
+ erc = ercs.get(2);
assertEquals("ERC3 name", "/maxAgeTest", erc.getRegionName());
- assertEquals("ERC3 queue size", 20000, erc.getEventQueueSize());
- lru = (LRUConfiguration) erc.getEvictionPolicyConfig();
- assertEquals("EPC3 pol", LRUPolicy.class.getName(),
lru.getEvictionPolicyClass());
+ assertEquals("ERC3 queue size", 1000, erc.getEventQueueSize());
+ LRUAlgorithmConfig lru = (LRUAlgorithmConfig) erc.getEvictionAlgorithmConfig();
assertEquals("EPC3 maxnodes", 10000, lru.getMaxNodes());
- assertEquals("EPC3 maxage", 10, lru.getMaxAgeSeconds());
- assertEquals("EPC3 ttl", 8, lru.getTimeToLiveSeconds());
+ assertEquals("EPC3 maxage", 10, lru.getMaxAge());
+ assertEquals("EPC3 ttl", 8, lru.getTimeToLive());
}
@@ -322,8 +309,8 @@
"</region>\n" +
"<region name=\"/maxAgeTest/\">\n" +
" <attribute
name=\"maxNodes\">10000</attribute>\n" +
- " <attribute
name=\"timeToLiveSeconds\">8</attribute>\n" +
- " <attribute
name=\"maxAgeSeconds\">10</attribute>\n" +
+ " <attribute
name=\"timeToLive\">8</attribute>\n" +
+ " <attribute
name=\"maxAge\">10</attribute>\n" +
"</region>\n" +
" </eviction>";
return XmlConfigHelper.stringToElementInCoreNS(xmlStr);