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

Manik Surtani msurtani at jboss.com
Thu Jan 11 08:49:05 EST 2007


  User: msurtani
  Date: 07/01/11 08:49:05

  Modified:    tests/functional/org/jboss/cache/marshall       
                        ReplicateToInactiveRegionTest.java
                        RegionManagerTest.java ActiveInactiveTest.java
                        AsyncReplTest.java RedeploymentEmulationTest.java
                        SyncReplTest.java LocalTest.java
  Log:
  Changed CacheImpl ctor to be protected, and changed cache factories accordingly
  
  Revision  Changes    Path
  1.3       +2 -1      JBossCache/tests/functional/org/jboss/cache/marshall/ReplicateToInactiveRegionTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ReplicateToInactiveRegionTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/marshall/ReplicateToInactiveRegionTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- ReplicateToInactiveRegionTest.java	30 Dec 2006 17:49:57 -0000	1.2
  +++ ReplicateToInactiveRegionTest.java	11 Jan 2007 13:49:05 -0000	1.3
  @@ -2,6 +2,7 @@
   
   import junit.framework.TestCase;
   import org.jboss.cache.CacheImpl;
  +import org.jboss.cache.DefaultCacheFactory;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.misc.TestingUtil;
   
  @@ -31,7 +32,7 @@
   
      private CacheImpl createCache() throws Exception
      {
  -      CacheImpl c = new CacheImpl();
  +      CacheImpl c = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
         c.getConfiguration().setCacheMode("REPL_SYNC");
         c.getConfiguration().setUseRegionBasedMarshalling(true);
         c.start();
  
  
  
  1.9       +4 -3      JBossCache/tests/functional/org/jboss/cache/marshall/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/marshall/RegionManagerTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- RegionManagerTest.java	3 Jan 2007 22:39:48 -0000	1.8
  +++ RegionManagerTest.java	11 Jan 2007 13:49:05 -0000	1.9
  @@ -2,6 +2,7 @@
   
   import junit.framework.TestCase;
   import org.jboss.cache.CacheImpl;
  +import org.jboss.cache.DefaultCacheFactory;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.Region;
   import org.jboss.cache.RegionManager;
  @@ -21,7 +22,7 @@
   
      public void setUp() throws Exception
      {
  -      CacheImpl c = new CacheImpl();
  +      CacheImpl c = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
         c.create();
         r = new RegionManager(c);
      }
  @@ -159,12 +160,12 @@
         assertEquals("r3 should be marshalling and active", 1, r.getAllMarshallingRegions().size());
         assertSame("r3 should be marshalling and active", r3, r.getAllMarshallingRegions().get(0));
   
  -      r4.activate(); // but don't se a class loader
  +      r4.activate();// but don't se a class loader
   
         assertEquals("r3 should be marshalling and active", 1, r.getAllMarshallingRegions().size());
         assertSame("r3 should be marshalling and active", r3, r.getAllMarshallingRegions().get(0));
   
  -      r2.registerContextClassLoader(getClass().getClassLoader());  // but don't activate
  +      r2.registerContextClassLoader(getClass().getClassLoader());// but don't activate
   
         assertEquals("r3 should be marshalling and active", 1, r.getAllMarshallingRegions().size());
         assertSame("r3 should be marshalling and active", r3, r.getAllMarshallingRegions().get(0));
  
  
  
  1.13      +2 -1      JBossCache/tests/functional/org/jboss/cache/marshall/ActiveInactiveTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ActiveInactiveTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/marshall/ActiveInactiveTest.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -b -r1.12 -r1.13
  --- ActiveInactiveTest.java	30 Dec 2006 17:49:57 -0000	1.12
  +++ ActiveInactiveTest.java	11 Jan 2007 13:49:05 -0000	1.13
  @@ -9,6 +9,7 @@
   
   import junit.framework.TestCase;
   import org.jboss.cache.CacheImpl;
  +import org.jboss.cache.DefaultCacheFactory;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.RegionManager;
   import org.jboss.cache.Version;
  @@ -30,7 +31,7 @@
      protected void setUp() throws Exception
      {
         super.setUp();
  -      c = new CacheImpl();
  +      c = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
         c.getConfiguration().setUseRegionBasedMarshalling(true);
         c.getConfiguration().setFetchInMemoryState(false);
         c.start();
  
  
  
  1.15      +3 -3      JBossCache/tests/functional/org/jboss/cache/marshall/AsyncReplTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AsyncReplTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/marshall/AsyncReplTest.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -b -r1.14 -r1.15
  --- AsyncReplTest.java	10 Jan 2007 16:58:43 -0000	1.14
  +++ AsyncReplTest.java	11 Jan 2007 13:49:05 -0000	1.15
  @@ -13,10 +13,10 @@
   import junit.framework.TestSuite;
   import org.apache.commons.logging.LogFactory;
   import org.jboss.cache.CacheImpl;
  +import org.jboss.cache.DefaultCacheFactory;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.config.Configuration.CacheMode;
   import org.jboss.cache.factories.UnitTestCacheFactory;
  -import org.jboss.cache.factories.XmlConfigurationParser;
   import org.jboss.cache.marshall.data.Address;
   import org.jboss.cache.marshall.data.Person;
   import org.jboss.cache.misc.TestingUtil;
  @@ -31,7 +31,7 @@
    * Test marshalling for async mode.
    *
    * @author Ben Wang
  - * @version $Revision: 1.14 $
  + * @version $Revision: 1.15 $
    */
   public class AsyncReplTest extends RegionBasedMarshallingTestBase
   {
  @@ -64,7 +64,7 @@
   
      private CacheImpl createCache(String name) throws Exception
      {
  -      CacheImpl cache = new CacheImpl();
  +      CacheImpl cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
         cache.setConfiguration(UnitTestCacheFactory.createConfiguration(CacheMode.REPL_ASYNC));
         cache.getConfiguration().setClusterName(name);
         // Use marshaller
  
  
  
  1.6       +5 -4      JBossCache/tests/functional/org/jboss/cache/marshall/RedeploymentEmulationTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RedeploymentEmulationTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/marshall/RedeploymentEmulationTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- RedeploymentEmulationTest.java	5 Jan 2007 16:29:40 -0000	1.5
  +++ RedeploymentEmulationTest.java	11 Jan 2007 13:49:05 -0000	1.6
  @@ -9,15 +9,16 @@
   import junit.framework.TestCase;
   import org.jboss.cache.Cache;
   import org.jboss.cache.CacheImpl;
  +import org.jboss.cache.DefaultCacheFactory;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.Region;
   import org.jboss.cache.config.Configuration;
   import org.jgroups.Global;
   
   import java.io.File;
  +import java.net.MalformedURLException;
   import java.net.URL;
   import java.net.URLClassLoader;
  -import java.net.MalformedURLException;
   
   /**
    * Unit test demonstrating usability of marshalling for application redeployment in application server.
  @@ -38,7 +39,7 @@
   
      protected void setUp() throws Exception
      {
  -      cache = new CacheImpl();
  +      cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
   
         cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
         cache.getConfiguration().setUseRegionBasedMarshalling(true);
  
  
  
  1.16      +3 -2      JBossCache/tests/functional/org/jboss/cache/marshall/SyncReplTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SyncReplTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/marshall/SyncReplTest.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -b -r1.15 -r1.16
  --- SyncReplTest.java	10 Jan 2007 15:39:52 -0000	1.15
  +++ SyncReplTest.java	11 Jan 2007 13:49:05 -0000	1.16
  @@ -12,6 +12,7 @@
   import junit.framework.Test;
   import junit.framework.TestSuite;
   import org.jboss.cache.CacheImpl;
  +import org.jboss.cache.DefaultCacheFactory;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.config.Configuration;
   import org.jboss.cache.config.Configuration.CacheMode;
  @@ -32,7 +33,7 @@
    * Test case for marshalling using Sync mode.
    *
    * @author Ben Wang
  - * @version $Revision: 1.15 $
  + * @version $Revision: 1.16 $
    */
   public class SyncReplTest extends RegionBasedMarshallingTestBase
   {
  @@ -64,7 +65,7 @@
   
      private CacheImpl createCache(String name) throws Exception
      {
  -      CacheImpl cache = new CacheImpl();
  +      CacheImpl cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
   
         XmlConfigurationParser parser = new XmlConfigurationParser();
         Configuration c = UnitTestCacheFactory.createConfiguration(CacheMode.REPL_SYNC);
  
  
  
  1.13      +3 -2      JBossCache/tests/functional/org/jboss/cache/marshall/LocalTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: LocalTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/marshall/LocalTest.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -b -r1.12 -r1.13
  --- LocalTest.java	31 Dec 2006 02:08:42 -0000	1.12
  +++ LocalTest.java	11 Jan 2007 13:49:05 -0000	1.13
  @@ -3,6 +3,7 @@
   import junit.framework.Test;
   import junit.framework.TestSuite;
   import org.jboss.cache.CacheImpl;
  +import org.jboss.cache.DefaultCacheFactory;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.config.Configuration;
   import org.jboss.cache.lock.IsolationLevel;
  @@ -18,7 +19,7 @@
    * Simple functional tests for LegacyTreeCacheMarshaller
    *
    * @author Ben Wang
  - * @version $Id: LocalTest.java,v 1.12 2006/12/31 02:08:42 msurtani Exp $
  + * @version $Id: LocalTest.java,v 1.13 2007/01/11 13:49:05 msurtani Exp $
    */
   public class LocalTest extends RegionBasedMarshallingTestBase
   {
  @@ -33,7 +34,7 @@
      protected void setUp() throws Exception
      {
         super.setUp();
  -      cache = new CacheImpl();
  +      cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
         cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
         cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
         cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
  
  
  



More information about the jboss-cvs-commits mailing list