[jboss-cvs] JBossCache/tests-50/functional/org/jboss/cache/pojo/passivation ...

Manik Surtani msurtani at jboss.com
Sat Dec 30 12:50:05 EST 2006


  User: msurtani
  Date: 06/12/30 12:50:05

  Modified:    tests-50/functional/org/jboss/cache/pojo/passivation  
                        ReplicatedTest.java LocalTest.java
  Log:
  Major changes to restructure cache and node object model
  
  Revision  Changes    Path
  1.9       +23 -17    JBossCache/tests-50/functional/org/jboss/cache/pojo/passivation/ReplicatedTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ReplicatedTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests-50/functional/org/jboss/cache/pojo/passivation/ReplicatedTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- ReplicatedTest.java	7 Nov 2006 03:58:58 -0000	1.8
  +++ ReplicatedTest.java	30 Dec 2006 17:50:05 -0000	1.9
  @@ -22,19 +22,19 @@
   
   package org.jboss.cache.pojo.passivation;
   
  -import junit.framework.TestCase;
   import junit.framework.Test;
  +import junit.framework.TestCase;
   import junit.framework.TestSuite;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  +import org.jboss.cache.CacheListener;
  +import org.jboss.cache.CacheSPI;
  +import org.jboss.cache.Fqn;
   import org.jboss.cache.pojo.PojoCache;
   import org.jboss.cache.pojo.PojoCacheFactory;
  -import org.jboss.cache.pojo.test.Person;
   import org.jboss.cache.pojo.test.Address;
   import org.jboss.cache.pojo.test.Link;
  -import org.jboss.cache.Fqn;
  -import org.jboss.cache.CacheListener;
  -import org.jboss.cache.CacheSPI;
  +import org.jboss.cache.pojo.test.Person;
   import org.jgroups.View;
   
   import java.util.Map;
  @@ -101,10 +101,10 @@
      private void sanityCheck() throws InterruptedException
      {
         Thread.sleep(100);
  -      if(listener_.getActivationCount() == 0 || listener_.getPassivationCount() == 0)
  +      if (listener_.getActivationCount() == 0 || listener_.getPassivationCount() == 0)
         {
  -         fail("Sanity checking for passivation failed. Counters: activation - " +listener_.getActivationCount()
  -          + " passivation - " +listener_.getPassivationCount());
  +         fail("Sanity checking for passivation failed. Counters: activation - " + listener_.getActivationCount()
  +                 + " passivation - " + listener_.getPassivationCount());
         }
   
         listener_.reset();
  @@ -119,9 +119,9 @@
         Thread.sleep(9100); // default is 3 seconds so joe should have been passivated.
   
         assertFalse("Node should be evicted ",
  -              cache_.getCache().hasChild(new Fqn(id)));
  +              cache_.getCache().getRoot().hasChild(new Fqn(id)));
   
  -      Person p = (Person)cache1_.find(id);
  +      Person p = (Person) cache1_.find(id);
         assertNotNull("Person on remote node ", p);
   
         sanityCheck();
  @@ -134,13 +134,13 @@
         Person joe = createPerson("Joe Black", 20);
         cache_.attach(id, joe);
   
  -      Person p = (Person)cache1_.find(id);
  +      Person p = (Person) cache1_.find(id);
         assertNotNull("Person on remote node ", p);
   
         Thread.sleep(9100); // default is 3 seconds so joe should have been passivated.
   
         assertFalse("Node should be evicted ",
  -              cache_.getCache().hasChild(new Fqn(id)));
  +              cache_.getCache().getRoot().hasChild(new Fqn(id)));
   
         Address addr = new Address();
         addr.setCity("Taipei");
  @@ -181,7 +181,7 @@
   
         Thread.sleep(9100); // default is 3 seconds so joe should have been passivated.
         assertFalse("Node should be evicted ",
  -              cache_.getCache().hasChild(new Fqn(id)));
  +              cache_.getCache().getRoot().hasChild(new Fqn(id)));
   
         assertEquals("City is ", "Santa Clara", add2.getCity());
   
  @@ -255,9 +255,15 @@
         int activation = 0;
         int passivation = 0;
   
  -      public int getActivationCount() { return activation;}
  +      public int getActivationCount()
  +      {
  +         return activation;
  +      }
   
  -      public int getPassivationCount() { return passivation;}
  +      public int getPassivationCount()
  +      {
  +         return passivation;
  +      }
   
         public void reset()
         {
  @@ -300,7 +306,7 @@
   
         public void nodeActivated(Fqn fqn, boolean pre)
         {
  -         if(!pre)
  +         if (!pre)
            {
               System.out.println("nodeActivated: " + fqn);
               activation++;
  @@ -309,7 +315,7 @@
   
         public void nodePassivated(Fqn fqn, boolean pre)
         {
  -         if(pre)
  +         if (pre)
            {
               System.out.println("nodePassivated: " + fqn);
               passivation++;
  
  
  
  1.10      +22 -19    JBossCache/tests-50/functional/org/jboss/cache/pojo/passivation/LocalTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: LocalTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests-50/functional/org/jboss/cache/pojo/passivation/LocalTest.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- LocalTest.java	8 Nov 2006 02:08:10 -0000	1.9
  +++ LocalTest.java	30 Dec 2006 17:50:05 -0000	1.10
  @@ -12,19 +12,16 @@
   import junit.framework.TestSuite;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  +import org.jboss.cache.CacheListener;
  +import org.jboss.cache.CacheSPI;
  +import org.jboss.cache.Fqn;
   import org.jboss.cache.pojo.PojoCache;
   import org.jboss.cache.pojo.PojoCacheFactory;
   import org.jboss.cache.pojo.test.Address;
   import org.jboss.cache.pojo.test.Link;
   import org.jboss.cache.pojo.test.Person;
  -import org.jboss.cache.Fqn;
  -import org.jboss.cache.CacheListener;
  -import org.jboss.cache.CacheSPI;
  -import org.jboss.util.id.UID;
   import org.jgroups.View;
   
  -import java.util.ArrayList;
  -import java.util.List;
   import java.util.Map;
   
   /**
  @@ -84,10 +81,10 @@
   
      private void sanityCheck()
      {
  -      if(listener_.getActivationCount() == 0 || listener_.getPassivationCount() == 0)
  +      if (listener_.getActivationCount() == 0 || listener_.getPassivationCount() == 0)
         {
  -         fail("Sanity checking for passivation failed. Counters: activation - " +listener_.getActivationCount()
  -          + " passivation - " +listener_.getPassivationCount());
  +         fail("Sanity checking for passivation failed. Counters: activation - " + listener_.getActivationCount()
  +                 + " passivation - " + listener_.getPassivationCount());
         }
   
         listener_.reset();
  @@ -104,7 +101,7 @@
   //      assertFalse("Node should be evicted ",
   //              cache_.getCache().exists(id));
         assertFalse("Node should be evicted ",
  -              cache_.getCache().hasChild(new Fqn(id)));
  +              cache_.getCache().getRoot().hasChild(new Fqn(id)));
   
         assertEquals("age ", 20, joe.getAge());
         joe.setAge(30);
  @@ -122,7 +119,7 @@
         Thread.sleep(9100); // default is 3 seconds so joe should have been passivated.
   
         assertFalse("Node should be evicted ",
  -              cache_.getCache().hasChild(new Fqn(id)));
  +              cache_.getCache().getRoot().hasChild(new Fqn(id)));
   
         Address addr = new Address();
         addr.setCity("Taipei");
  @@ -144,14 +141,14 @@
   //      assertFalse("Node should be evicted ",
   //              cache_.getCache().exists(id));
         assertFalse("Node should be evicted ",
  -              cache_.getCache().hasChild(new Fqn(id)));
  +              cache_.getCache().getRoot().hasChild(new Fqn(id)));
   
   //      assertFalse("Node should be evicted ",
   //              cache_.getCache().exists(id));
         assertFalse("Node should be evicted ",
  -              cache_.getCache().hasChild(new Fqn(id)));
  +              cache_.getCache().getRoot().hasChild(new Fqn(id)));
   
  -      Person p = (Person)cache_.find(id);
  +      Person p = (Person) cache_.find(id);
   
         assertEquals("age ", 20, joe.getAge());
         joe.setAge(30);
  @@ -196,7 +193,7 @@
   //      assertFalse("Node should be evicted ",
   //              cache_.getCache().exists("/person/joe"));
         assertFalse("Node should be evicted ",
  -              cache_.getCache().hasChild(new Fqn(id)));
  +              cache_.getCache().getRoot().hasChild(new Fqn(id)));
   
         assertEquals("City is ", "Santa Clara", add2.getCity());
   
  @@ -270,9 +267,15 @@
         int activation = 0;
         int passivation = 0;
   
  -      public int getActivationCount() { return activation;}
  +      public int getActivationCount()
  +      {
  +         return activation;
  +      }
   
  -      public int getPassivationCount() { return passivation;}
  +      public int getPassivationCount()
  +      {
  +         return passivation;
  +      }
   
         public void reset()
         {
  @@ -315,7 +318,7 @@
   
         public void nodeActivated(Fqn fqn, boolean pre)
         {
  -         if(!pre)
  +         if (!pre)
            {
               System.out.println("nodeActivated: " + fqn);
               activation++;
  @@ -324,7 +327,7 @@
   
         public void nodePassivated(Fqn fqn, boolean pre)
         {
  -         if(pre)
  +         if (pre)
            {
               System.out.println("nodePassivated: " + fqn);
               passivation++;
  
  
  



More information about the jboss-cvs-commits mailing list