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

Manik Surtani msurtani at jboss.com
Sat Dec 30 12:49:57 EST 2006


  User: msurtani
  Date: 06/12/30 12:49:57

  Modified:    tests/functional/org/jboss/cache/mgmt      
                        MgmtCoreTest.java InvalidationTest.java TxTest.java
                        NotificationTest.java CacheLoaderTest.java
                        PassivationTest.java
  Log:
  Major changes to restructure cache and node object model
  
  Revision  Changes    Path
  1.8       +4 -4      JBossCache/tests/functional/org/jboss/cache/mgmt/MgmtCoreTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MgmtCoreTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/mgmt/MgmtCoreTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- MgmtCoreTest.java	10 Nov 2006 02:48:45 -0000	1.7
  +++ MgmtCoreTest.java	30 Dec 2006 17:49:57 -0000	1.8
  @@ -3,8 +3,8 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.TreeCache;
   import org.jboss.cache.config.Configuration;
   import org.jboss.cache.interceptors.CacheMgmtInterceptor;
   
  @@ -15,7 +15,7 @@
    * Simple functional tests for CacheMgmtInterceptor
    *
    * @author Jerry Gauthier
  - * @version $Id: MgmtCoreTest.java,v 1.7 2006/11/10 02:48:45 bstansberry Exp $
  + * @version $Id: MgmtCoreTest.java,v 1.8 2006/12/30 17:49:57 msurtani Exp $
    */
   public class MgmtCoreTest extends TestCase
   {
  @@ -24,12 +24,12 @@
      private static final String POPULATION = "population";
      private static final String AREA = "area";
   
  -   TreeCache cache = null;
  +   CacheImpl cache = null;
   
      protected void setUp() throws Exception
      {
         super.setUp();
  -      cache = new TreeCache();
  +      cache = new CacheImpl();
         cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
         cache.getConfiguration().setExposeManagementStatistics(true);
         cache.create();
  
  
  
  1.9       +9 -9      JBossCache/tests/functional/org/jboss/cache/mgmt/InvalidationTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: InvalidationTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/mgmt/InvalidationTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- InvalidationTest.java	10 Nov 2006 02:48:45 -0000	1.8
  +++ InvalidationTest.java	30 Dec 2006 17:49:57 -0000	1.9
  @@ -3,8 +3,8 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.TreeCache;
   import org.jboss.cache.config.Configuration;
   import org.jboss.cache.factories.XmlConfigurationParser;
   import org.jboss.cache.interceptors.InvalidationInterceptor;
  @@ -16,7 +16,7 @@
    * Simple functional tests for InvalidationInterceptor statistics
    *
    * @author Jerry Gauthier
  - * @version $Id: InvalidationTest.java,v 1.8 2006/11/10 02:48:45 bstansberry Exp $
  + * @version $Id: InvalidationTest.java,v 1.9 2006/12/30 17:49:57 msurtani Exp $
    */
   public class InvalidationTest extends TestCase
   {
  @@ -26,8 +26,8 @@
      private static final String POPULATION = "population";
      private static final String AREA = "area";
   
  -   TreeCache cache1 = null;
  -   TreeCache cache2 = null;
  +   CacheImpl cache1 = null;
  +   CacheImpl cache2 = null;
   
      protected void setUp() throws Exception
      {
  @@ -109,7 +109,7 @@
   
      }
   
  -   private void loadCache1(TreeCache cache) throws Exception
  +   private void loadCache1(CacheImpl cache) throws Exception
      {
         cache.put("Europe", new HashMap());
         cache.put("Europe/Austria", new HashMap());
  @@ -126,7 +126,7 @@
   
      }
   
  -   private void loadCache2(TreeCache cache) throws Exception
  +   private void loadCache2(CacheImpl cache) throws Exception
      {
         cache.put("Europe", new HashMap());
         cache.put("Europe/Austria", new HashMap());
  @@ -142,9 +142,9 @@
   
      }
   
  -   private TreeCache createCache(String clusterName) throws Exception
  +   private CacheImpl createCache(String clusterName) throws Exception
      {
  -      TreeCache cache = new TreeCache();
  +      CacheImpl cache = new CacheImpl();
         XmlConfigurationParser parser = new XmlConfigurationParser();
         Configuration c = parser.parseFile("META-INF/invalidationSync-service.xml");
         cache.setConfiguration(c);
  @@ -156,7 +156,7 @@
         return cache;
      }
   
  -   private InvalidationInterceptor getInvalidationInterceptor(TreeCache cache)
  +   private InvalidationInterceptor getInvalidationInterceptor(CacheImpl cache)
      {
         List interceptors = cache.getInterceptors();
         if (interceptors.isEmpty())
  
  
  
  1.9       +11 -11    JBossCache/tests/functional/org/jboss/cache/mgmt/TxTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TxTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/mgmt/TxTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- TxTest.java	10 Nov 2006 02:48:45 -0000	1.8
  +++ TxTest.java	30 Dec 2006 17:49:57 -0000	1.9
  @@ -3,8 +3,8 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.TreeCache;
   import org.jboss.cache.config.Configuration;
   import org.jboss.cache.factories.XmlConfigurationParser;
   import org.jboss.cache.interceptors.TxInterceptor;
  @@ -17,7 +17,7 @@
    * Simple functional tests for TxInterceptor statistics
    *
    * @author Jerry Gauthier
  - * @version $Id: TxTest.java,v 1.8 2006/11/10 02:48:45 bstansberry Exp $
  + * @version $Id: TxTest.java,v 1.9 2006/12/30 17:49:57 msurtani Exp $
    */
   public class TxTest extends TestCase
   {
  @@ -27,8 +27,8 @@
      private static final String POPULATION = "population";
      private static final String AREA = "area";
   
  -   TreeCache cache1 = null;
  -   TreeCache cache2 = null;
  +   CacheImpl cache1 = null;
  +   CacheImpl cache2 = null;
   
      protected void setUp() throws Exception
      {
  @@ -134,7 +134,7 @@
         assertEquals("Cache2 Tx Rollbacks error after reset: ", new Long(0), new Long(tx2.getRollbacks()));
      }
   
  -   private void loadCacheNoTx(TreeCache cache) throws Exception
  +   private void loadCacheNoTx(CacheImpl cache) throws Exception
      {
         cache.put("Europe", new HashMap());
         cache.put("Europe/Austria", new HashMap());
  @@ -150,7 +150,7 @@
         cache.put("Europe/Albania", albania);
      }
   
  -   private void loadCacheTxCommit(TreeCache cache, TransactionManager tm) throws Exception
  +   private void loadCacheTxCommit(CacheImpl cache, TransactionManager tm) throws Exception
      {
         tm.begin();
   
  @@ -167,7 +167,7 @@
         tm.commit();
      }
   
  -   private void loadCacheTxCommit2(TreeCache cache, TransactionManager tm) throws Exception
  +   private void loadCacheTxCommit2(CacheImpl cache, TransactionManager tm) throws Exception
      {
         tm.begin();
   
  @@ -188,7 +188,7 @@
         tm.commit();
      }
   
  -   private void loadCacheTxRollback(TreeCache cache, TransactionManager tm) throws Exception
  +   private void loadCacheTxRollback(CacheImpl cache, TransactionManager tm) throws Exception
      {
         tm.begin();
   
  @@ -205,9 +205,9 @@
         tm.rollback();
      }
   
  -   private TreeCache createCache(String clusterName) throws Exception
  +   private CacheImpl createCache(String clusterName) throws Exception
      {
  -      TreeCache cache = new TreeCache();
  +      CacheImpl cache = new CacheImpl();
         cache.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/replSync-service.xml"));
         cache.getConfiguration().setUseRegionBasedMarshalling(false);
         cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
  @@ -218,7 +218,7 @@
         return cache;
      }
   
  -   private TxInterceptor getTxInterceptor(TreeCache cache)
  +   private TxInterceptor getTxInterceptor(CacheImpl cache)
      {
         List interceptors = cache.getInterceptors();
         if (interceptors.isEmpty())
  
  
  
  1.15      +7 -7      JBossCache/tests/functional/org/jboss/cache/mgmt/NotificationTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NotificationTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/mgmt/NotificationTest.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -b -r1.14 -r1.15
  --- NotificationTest.java	16 Nov 2006 14:14:11 -0000	1.14
  +++ NotificationTest.java	30 Dec 2006 17:49:57 -0000	1.15
  @@ -1,14 +1,14 @@
   package org.jboss.cache.mgmt;
   
   import junit.framework.TestCase;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.TreeCache;
   import org.jboss.cache.config.CacheLoaderConfig;
   import org.jboss.cache.config.Configuration;
   import org.jboss.cache.factories.XmlConfigurationParser;
   import org.jboss.cache.interceptors.CacheMgmtInterceptor;
  -import org.jboss.cache.jmx.JmxUtil;
   import org.jboss.cache.jmx.Cache;
  +import org.jboss.cache.jmx.JmxUtil;
   import org.jboss.cache.loader.CacheLoader;
   import org.jboss.cache.xml.XmlHelper;
   import org.w3c.dom.Element;
  @@ -24,7 +24,7 @@
    * Functional tests for CacheMgmtInterceptor broadcast of cache event notifications
    *
    * @author Jerry Gauthier
  - * @version $Id: NotificationTest.java,v 1.14 2006/11/16 14:14:11 msurtani Exp $
  + * @version $Id: NotificationTest.java,v 1.15 2006/12/30 17:49:57 msurtani Exp $
    */
   public class NotificationTest extends TestCase
   {
  @@ -58,7 +58,7 @@
   
      private MBeanServer m_server;
   
  -   TreeCache cache = null;
  +   CacheImpl cache = null;
      boolean optimistic = false;
   
      protected void setUp() throws Exception
  @@ -68,7 +68,7 @@
         cache = createCache(CLUSTER_NAME);
         // bind manually for now.
         ObjectName mgmt = new ObjectName(JmxUtil.PREFIX + cache.getConfiguration().getClusterName() + MGMT_SERVICE);
  -      Cache cacheMBean = new Cache(cache.getCacheSPI());
  +      Cache cacheMBean = new Cache(cache);
   
         m_server.registerMBean(cacheMBean, mgmt);
      }
  @@ -156,9 +156,9 @@
         assertTrue("Expected ViewChange notification", m_viewChange);
      }
   
  -   private TreeCache createCache(String clusterName) throws Exception
  +   private CacheImpl createCache(String clusterName) throws Exception
      {
  -      TreeCache cache = new TreeCache();
  +      CacheImpl cache = new CacheImpl();
         cache.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/replSync-service.xml"));
         cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
         cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig("location=" + getTempDir()));
  
  
  
  1.10      +8 -8      JBossCache/tests/functional/org/jboss/cache/mgmt/CacheLoaderTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheLoaderTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/mgmt/CacheLoaderTest.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- CacheLoaderTest.java	10 Nov 2006 02:48:45 -0000	1.9
  +++ CacheLoaderTest.java	30 Dec 2006 17:49:57 -0000	1.10
  @@ -3,8 +3,8 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.TreeCache;
   import org.jboss.cache.config.CacheLoaderConfig;
   import org.jboss.cache.config.Configuration;
   import org.jboss.cache.factories.XmlConfigurationParser;
  @@ -21,7 +21,7 @@
    * Simple functional tests for CacheLoaderInterceptor and CacheStoreInterceptor statistics
    *
    * @author Jerry Gauthier
  - * @version $Id: CacheLoaderTest.java,v 1.9 2006/11/10 02:48:45 bstansberry Exp $
  + * @version $Id: CacheLoaderTest.java,v 1.10 2006/12/30 17:49:57 msurtani Exp $
    */
   public class CacheLoaderTest extends TestCase
   {
  @@ -31,7 +31,7 @@
      private static final String AREA = "area";
      private static final String EUROPE_NODE = "Europe";
   
  -   TreeCache cache = null;
  +   CacheImpl cache = null;
   
      protected void setUp() throws Exception
      {
  @@ -171,7 +171,7 @@
         assertEquals("CacheLoaderStores count error after reset: ", new Long(0), new Long(store.getCacheLoaderStores()));
      }
   
  -   private void loadCache(TreeCache cache) throws Exception
  +   private void loadCache(CacheImpl cache) throws Exception
      {
         cache.put(EUROPE_NODE, new HashMap());
         cache.put("Europe/Austria", new HashMap());
  @@ -200,9 +200,9 @@
   
      }
   
  -   private TreeCache createCache() throws Exception
  +   private CacheImpl createCache() throws Exception
      {
  -      TreeCache cache = new TreeCache();
  +      CacheImpl cache = new CacheImpl();
         cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
         cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig("location=" + getTempDir()));
         cache.getConfiguration().setExposeManagementStatistics(true);
  @@ -211,7 +211,7 @@
         return cache;
      }
   
  -   private CacheLoaderInterceptor getCacheLoaderInterceptor(TreeCache cache)
  +   private CacheLoaderInterceptor getCacheLoaderInterceptor(CacheImpl cache)
      {
         List interceptors = cache.getInterceptors();
         if (interceptors.isEmpty())
  @@ -226,7 +226,7 @@
         return null;
      }
   
  -   private CacheStoreInterceptor getCacheStoreInterceptor(TreeCache cache)
  +   private CacheStoreInterceptor getCacheStoreInterceptor(CacheImpl cache)
      {
         List interceptors = cache.getInterceptors();
         if (interceptors.isEmpty())
  
  
  
  1.8       +8 -8      JBossCache/tests/functional/org/jboss/cache/mgmt/PassivationTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: PassivationTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/mgmt/PassivationTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- PassivationTest.java	10 Nov 2006 02:48:45 -0000	1.7
  +++ PassivationTest.java	30 Dec 2006 17:49:57 -0000	1.8
  @@ -3,8 +3,8 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Fqn;
  -import org.jboss.cache.TreeCache;
   import org.jboss.cache.config.CacheLoaderConfig;
   import org.jboss.cache.config.Configuration;
   import org.jboss.cache.factories.XmlConfigurationParser;
  @@ -21,7 +21,7 @@
    * Simple functional tests for ActivationInterceptor and PassivationInterceptor statistics
    *
    * @author Jerry Gauthier
  - * @version $Id: PassivationTest.java,v 1.7 2006/11/10 02:48:45 bstansberry Exp $
  + * @version $Id: PassivationTest.java,v 1.8 2006/12/30 17:49:57 msurtani Exp $
    */
   public class PassivationTest extends TestCase
   {
  @@ -31,7 +31,7 @@
      private static final String AREA = "area";
      private static final String EUROPE_NODE = "Europe";
   
  -   TreeCache cache = null;
  +   CacheImpl cache = null;
   
      protected void setUp() throws Exception
      {
  @@ -196,7 +196,7 @@
         assertEquals("Passivations count error: ", new Long(0), new Long(pass.getPassivations()));
      }
   
  -   private void loadCache(TreeCache cache) throws Exception
  +   private void loadCache(CacheImpl cache) throws Exception
      {
         cache.put(EUROPE_NODE, new HashMap());
         cache.put("Europe/Austria", new HashMap());
  @@ -224,9 +224,9 @@
         cache.put("Europe/Hungary", hungary);
      }
   
  -   private TreeCache createCache() throws Exception
  +   private CacheImpl createCache() throws Exception
      {
  -      TreeCache cache = new TreeCache();
  +      CacheImpl cache = new CacheImpl();
         Configuration c = new Configuration();
         c.setCacheMode("LOCAL");
         c.setCacheLoaderConfig(getCacheLoaderConfig("location=" + getTempDir()));
  @@ -237,7 +237,7 @@
         return cache;
      }
   
  -   private ActivationInterceptor getActivationInterceptor(TreeCache cache)
  +   private ActivationInterceptor getActivationInterceptor(CacheImpl cache)
      {
         List interceptors = cache.getInterceptors();
         if (interceptors.isEmpty())
  @@ -252,7 +252,7 @@
         return null;
      }
   
  -   private PassivationInterceptor getPassivationInterceptor(TreeCache cache)
  +   private PassivationInterceptor getPassivationInterceptor(CacheImpl cache)
      {
         List interceptors = cache.getInterceptors();
         if (interceptors.isEmpty())
  
  
  



More information about the jboss-cvs-commits mailing list