[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/eviction ...

Brian Stansberry brian.stansberry at jboss.com
Wed Oct 25 00:50:21 EDT 2006


  User: bstansberry
  Date: 06/10/25 00:50:21

  Modified:    tests/functional/org/jboss/cache/eviction  
                        ProgrammaticLRUPolicyTest.java
                        RegionManagerTest.java
  Log:
  Handle parsing of config XML in XmlConfigurationParser 
  
  Revision  Changes    Path
  1.3       +4 -4      JBossCache/tests/functional/org/jboss/cache/eviction/ProgrammaticLRUPolicyTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ProgrammaticLRUPolicyTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/eviction/ProgrammaticLRUPolicyTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- ProgrammaticLRUPolicyTest.java	23 Oct 2006 05:47:30 -0000	1.2
  +++ ProgrammaticLRUPolicyTest.java	25 Oct 2006 04:50:21 -0000	1.3
  @@ -30,7 +30,7 @@
   import org.jboss.cache.xml.XmlHelper;
   import org.jboss.cache.misc.TestingUtil;
   import org.jboss.cache.lock.IsolationLevel;
  -import org.jboss.cache.config.EvictionConfig.EvictionRegionConfig;
  +import org.jboss.cache.config.EvictionRegionConfig;
   import org.jboss.cache.factories.XmlConfigurationParser;
   import org.w3c.dom.Element;
   
  @@ -38,7 +38,7 @@
    * Unit tests for programmatic configuration of LRU policy
    *
    * @author Ben Wang, Oct, 2006
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public class ProgrammaticLRUPolicyTest extends TestCase
   {
  @@ -87,7 +87,7 @@
               "</region>";
         Element element = XmlHelper.stringToElement(xml);
         RegionManager regionManager = cache_.getEvictionRegionManager();
  -      EvictionRegionConfig erc = new EvictionRegionConfig(element, regionManager.getEvictionConfig().getDefaultEvictionPolicyClass());
  +      EvictionRegionConfig erc = XmlConfigurationParser.parseEvictionRegionConfig(element, regionManager.getEvictionConfig().getDefaultEvictionPolicyClass());
         // Fqn is the region name
         regionManager.createRegion("/programmatic", erc);
      }
  @@ -147,7 +147,7 @@
               "</region>";
         Element element = XmlHelper.stringToElement(xml);
         RegionManager regionManager = cache_.getEvictionRegionManager();
  -      EvictionRegionConfig erc = new EvictionRegionConfig(element, regionManager.getEvictionConfig().getDefaultEvictionPolicyClass());
  +      EvictionRegionConfig erc = XmlConfigurationParser.parseEvictionRegionConfig(element, regionManager.getEvictionConfig().getDefaultEvictionPolicyClass());
         // Fqn is the region name
         Integer ii = new Integer(1);
         Fqn fqn = new Fqn(ii);
  
  
  
  1.14      +6 -6      JBossCache/tests/functional/org/jboss/cache/eviction/RegionManagerTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RegionManagerTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/eviction/RegionManagerTest.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -b -r1.13 -r1.14
  --- RegionManagerTest.java	23 Oct 2006 05:47:30 -0000	1.13
  +++ RegionManagerTest.java	25 Oct 2006 04:50:21 -0000	1.14
  @@ -4,7 +4,8 @@
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
   import org.jboss.cache.TreeCache;
  -import org.jboss.cache.config.EvictionConfig.EvictionRegionConfig;
  +import org.jboss.cache.config.EvictionRegionConfig;
  +import org.jboss.cache.factories.XmlConfigurationParser;
   import org.jboss.cache.xml.XmlHelper;
   import org.w3c.dom.Element;
   
  @@ -13,7 +14,7 @@
    *
    * @author Ben Wang, Feb 11, 2004
    * @author Daniel Huang (dhuang at jboss.org)
  - * @version $Revision: 1.13 $
  + * @version $Revision: 1.14 $
    */
   public class RegionManagerTest extends TestCase
   {
  @@ -204,7 +205,7 @@
                 "</region>";
         Element element = XmlHelper.stringToElement(xml);
         RegionManager regionManager = new RegionManager();
  -      EvictionRegionConfig erc = new EvictionRegionConfig(element, regionManager.getEvictionConfig().getDefaultEvictionPolicyClass());
  +      EvictionRegionConfig erc = XmlConfigurationParser.parseEvictionRegionConfig(element, regionManager.getEvictionConfig().getDefaultEvictionPolicyClass());
         Region region = regionManager.createRegion(erc);
   
         assertTrue(region.getEvictionPolicy() instanceof LFUPolicy);
  @@ -215,7 +216,6 @@
         assertEquals("/test/", region.getFqn());
   
         TreeCache cache = new TreeCache();
  -      cache.getConfiguration().setEvictionPolicyClass("org.jboss.cache.eviction.LFUPolicy");
   
         // test the 1.2.x style configuration
         xml = "<region name=\"abc\">" +
  @@ -223,9 +223,9 @@
                 "<attribute name=\"maxNodes\">20</attribute>" +
                 "</region>";
         element = XmlHelper.stringToElement(xml);
  +      erc = XmlConfigurationParser.parseEvictionRegionConfig(element, "org.jboss.cache.eviction.LFUPolicy");
         regionManager = new RegionManager();
         regionManager.setTreeCache(cache);
  -      erc = new EvictionRegionConfig(element, regionManager.getEvictionConfig().getDefaultEvictionPolicyClass());
         region = regionManager.createRegion(erc);
   
         assertTrue(region.getEvictionPolicy() instanceof LFUPolicy);
  
  
  



More information about the jboss-cvs-commits mailing list