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

Ben Wang bwang at jboss.com
Tue Sep 5 02:28:15 EDT 2006


  User: bwang   
  Date: 06/09/05 02:28:15

  Modified:    tests-50/functional/org/jboss/cache/pojo/memory 
                        ReplicatedTest.java
  Log:
  Updated api
  
  Revision  Changes    Path
  1.2       +13 -11    JBossCache/tests-50/functional/org/jboss/cache/pojo/memory/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/memory/ReplicatedTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- ReplicatedTest.java	17 Jul 2006 14:41:28 -0000	1.1
  +++ ReplicatedTest.java	5 Sep 2006 06:28:15 -0000	1.2
  @@ -18,6 +18,7 @@
   import org.jboss.cache.pojo.test.Address;
   import org.jboss.cache.pojo.test.Person;
   import org.jboss.cache.pojo.test.SerializedAddress;
  +import org.jboss.cache.Fqn;
   
   import java.lang.ref.WeakReference;
   import java.util.ArrayList;
  @@ -68,17 +69,18 @@
   
         ClassLoader cla = getClassLoader();
         WeakReference refa = new WeakReference(cla);
  -      cache_.getCache().registerClassLoader("/aop", cla);
  +      cache_.getCache().getRegion(new Fqn("/aop")).registerContextClassLoader(cla);
         ClassLoader clb = getClassLoader();
         WeakReference refb = new WeakReference(clb);
  -      cache1_.getCache().registerClassLoader("/aop", clb);
  +      cache_.getCache().getRegion(new Fqn("/aop")).registerContextClassLoader(clb);
   
  -      cache_.getCache().put("/aop", "add", add);
  +      Fqn fqn = new Fqn("/aop");
  +      cache_.getCache().put(new Fqn("/aop"), "add", add);
   
         TestingUtil.sleepThread(100);
         try
         {
  -         Object ben = cache1_.getCache().get("/aop", "add");
  +         Object ben = cache1_.getCache().get(fqn, "add");
            assertEquals(add.toString(), ben.toString());
            ben = null;
         } catch (Exception ex)
  @@ -86,13 +88,13 @@
            fail("Test fails with exception " + ex);
         }
   
  -      cache_.getCache().remove("/aop", "add");
  +      cache_.getCache().remove(fqn, "add");
   
         ClassLoader clc = getClassLoader();
         cla = null;
         clb = null;
  -      cache_.getCache().registerClassLoader("/aop", clc); // replace cla
  -      cache1_.getCache().registerClassLoader("/aop", clc); // replace cla
  +      cache_.getCache().getRegion(new Fqn("/aop")).registerContextClassLoader(clc);
  +      cache1_.getCache().getRegion(new Fqn("/aop")).registerContextClassLoader(clc);
         System.gc(); // force gc
         Thread.currentThread().sleep(1000);
         assertNull("Classloader should be gced ", refa.get());
  @@ -134,9 +136,9 @@
   
         ClassLoader cla = getClassLoader();
         WeakReference refa = new WeakReference(cla);
  -      cache_.getCache().registerClassLoader("/aop", cla);
  +      cache_.getCache().getRegion(new Fqn("/aop")).registerContextClassLoader(cla);
         ClassLoader clb = getClassLoader();
  -      cache1_.getCache().registerClassLoader("/aop", clb);
  +      cache1_.getCache().getRegion(new Fqn("/aop")).registerContextClassLoader(clb);
         WeakReference refb = new WeakReference(clb);
   
         cache_.attach("/aop", p);
  @@ -154,8 +156,8 @@
   
         cache_.detach("/aop");
         ClassLoader clc = getClassLoader();
  -      cache_.getCache().registerClassLoader("/aop", clc); // replace cla
  -      cache1_.getCache().registerClassLoader("/aop", clc); // replace cla
  +      cache_.getCache().getRegion(new Fqn("/aop")).registerContextClassLoader(clc);
  +      cache1_.getCache().getRegion(new Fqn("/aop")).registerContextClassLoader(clc);
         cla = null;
         clb = null;
         forceOutOfMemoryError();
  
  
  



More information about the jboss-cvs-commits mailing list