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

Manik Surtani msurtani at jboss.com
Wed Nov 15 18:48:32 EST 2006


  User: msurtani
  Date: 06/11/15 18:48:32

  Modified:    tests/functional/org/jboss/cache/marshall  
                        RegionManagerTest.java ActiveInactiveTest.java
  Log:
  Fixed some failing UTs
  
  Revision  Changes    Path
  1.6       +3 -2      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.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- RegionManagerTest.java	14 Nov 2006 14:17:12 -0000	1.5
  +++ RegionManagerTest.java	15 Nov 2006 23:48:32 -0000	1.6
  @@ -4,6 +4,7 @@
   import org.jboss.cache.Fqn;
   import org.jboss.cache.Region;
   import org.jboss.cache.RegionManager;
  +import org.jboss.cache.TreeCache;
   
   import java.util.ArrayList;
   import java.util.Collections;
  @@ -15,12 +16,12 @@
    */
   public class RegionManagerTest extends TestCase
   {
  -   private final Fqn DEFAULT_REGION = Fqn.fromString("/_default_/");
  +   private final Fqn DEFAULT_REGION = Fqn.ROOT;
      private RegionManager r;
   
      public void setUp() throws Exception
      {
  -      r = new RegionManager();
  +      r = new RegionManager(new TreeCache());
      }
   
      public void tearDown() throws Exception
  
  
  
  1.11      +29 -11    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.10
  retrieving revision 1.11
  diff -u -b -r1.10 -r1.11
  --- ActiveInactiveTest.java	18 Oct 2006 11:07:54 -0000	1.10
  +++ ActiveInactiveTest.java	15 Nov 2006 23:48:32 -0000	1.11
  @@ -10,6 +10,7 @@
   import junit.framework.TestCase;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.RegionManager;
  +import org.jboss.cache.TreeCache;
   import org.jboss.cache.Version;
   
   import java.lang.reflect.Method;
  @@ -22,10 +23,31 @@
    */
   public class ActiveInactiveTest extends TestCase
   {
  +   RegionManager rman;
  +   TreeCache c;
  +
  +   @Override
  +   protected void setUp() throws Exception
  +   {
  +      super.setUp();
  +      c = new TreeCache();
  +      c.getConfiguration().setUseRegionBasedMarshalling(true);
  +      c.getConfiguration().setFetchInMemoryState(false);
  +      c.start();
  +      rman = c.getRegionManager();
  +   }
  +
  +   @Override
  +   protected void tearDown() throws Exception
  +   {
  +      super.tearDown();
  +      c.stop();
  +      c = null;
  +      rman = null;
  +   }
   
      public void testDefaultActive() throws Exception
      {
  -      RegionManager rman = new RegionManager();
         rman.setDefaultInactive(false);
         VersionAwareMarshaller testee = new VersionAwareMarshaller(rman, false, true, Version.getVersionString(Version.getVersionShort()));
         assertFalse("Root is not active", testee.isInactive("/"));
  @@ -46,7 +68,6 @@
   
      public void testDefaultInactive() throws Exception
      {
  -      RegionManager rman = new RegionManager();
         rman.setDefaultInactive(true);
         VersionAwareMarshaller testee = new VersionAwareMarshaller(rman, true, true, Version.getVersionString(Version.getVersionShort()));
         assertTrue("Root is not inactive", testee.isInactive("/"));
  @@ -67,7 +88,6 @@
   
      public void testActivate() throws Exception
      {
  -      RegionManager rman = new RegionManager();
         rman.setDefaultInactive(false);
         VersionAwareMarshaller defaultActive = new VersionAwareMarshaller(rman, false, true, Version.getVersionString(Version.getVersionShort()));
   
  @@ -80,7 +100,7 @@
         assertFalse("/a is not active after reactivating",
                 defaultActive.isInactive("/a"));
   
  -      rman = new RegionManager();
  +      rman.reset();
         rman.setDefaultInactive(true);
         VersionAwareMarshaller defaultInactive = new VersionAwareMarshaller(rman, true, true, Version.getVersionString(Version.getVersionShort()));
   
  @@ -98,7 +118,6 @@
   
      public void testInactivate() throws Exception
      {
  -      RegionManager rman = new RegionManager();
         rman.setDefaultInactive(true);
         VersionAwareMarshaller defaultInactive = new VersionAwareMarshaller(rman, true, true, Version.getVersionString(Version.getVersionShort()));
   
  @@ -111,18 +130,18 @@
         assertTrue("/i is not inactive after re-inactivating",
                 defaultInactive.isInactive("/i"));
   
  -      RegionManager rman2 = new RegionManager();
  +      rman.reset();
         rman.setDefaultInactive(false);
  -      VersionAwareMarshaller defaultActive = new VersionAwareMarshaller(rman2, false, true, Version.getVersionString(Version.getVersionShort()));
  +      VersionAwareMarshaller defaultActive = new VersionAwareMarshaller(rman, false, true, Version.getVersionString(Version.getVersionShort()));
   
  -      rman2.deactivate("/a");
  +      rman.deactivate("/a");
         assertTrue("/a is not inactive after inactivating",
                 defaultInactive.isInactive("/a"));
         assertTrue("/a/b is not inactive after inactivating /a",
                 defaultInactive.isInactive("/a/b"));
   
  -      rman2.activate("/a");
  -      rman2.deactivate("/a");
  +      rman.activate("/a");
  +      rman.deactivate("/a");
         assertTrue("/a is not inactive after re-inactivating",
                 defaultInactive.isInactive("/a"));
      }
  @@ -134,7 +153,6 @@
   
         MethodCall replicate = MethodCallFactory.create(MethodDeclarations.replicateMethod, put);
   
  -      RegionManager rman = new RegionManager();
         rman.setDefaultInactive(true);
         VersionAwareMarshaller testee = new VersionAwareMarshaller(rman, true, true, Version.getVersionString(Version.getVersionShort()));
         byte[] callBytes = testee.objectToByteBuffer(replicate);
  
  
  



More information about the jboss-cvs-commits mailing list