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

Manik Surtani manik at jboss.org
Mon Jul 16 22:03:26 EDT 2007


  User: msurtani
  Date: 07/07/16 22:03:26

  Modified:    tests/functional/org/jboss/cache/passivation   
                        PassivationTestsBase.java
                        PassivationActivationCallbacksTestCase.java
  Added:       tests/functional/org/jboss/cache/passivation   
                        PassivationToDummyInMemoryCacheLoaderTest.java
  Log:
  refactored tests
  
  Revision  Changes    Path
  1.32      +33 -45    JBossCache/tests/functional/org/jboss/cache/passivation/PassivationTestsBase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: PassivationTestsBase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/passivation/PassivationTestsBase.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -b -r1.31 -r1.32
  --- PassivationTestsBase.java	13 Jul 2007 14:31:42 -0000	1.31
  +++ PassivationTestsBase.java	17 Jul 2007 02:03:26 -0000	1.32
  @@ -1,8 +1,6 @@
   package org.jboss.cache.passivation;
   
  -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.CacheException;
  @@ -39,7 +37,7 @@
    * Base tests for passivation using any of the cache loaders
    *
    * @author <a href="mailto:{hmesha at novell.com}">{Hany Mesha}</a>
  - * @version $Id: PassivationTestsBase.java,v 1.31 2007/07/13 14:31:42 msurtani Exp $
  + * @version $Id: PassivationTestsBase.java,v 1.32 2007/07/17 02:03:26 msurtani Exp $
    */
   abstract public class PassivationTestsBase extends TestCase
   {
  @@ -591,6 +589,8 @@
         addDelay();
         assertTrue(loader.exists(Fqn.fromString("/a")));
         assertNull(cache.get("/a", "test"));// load attributes from loader
  +      // don't remove from loader though since children may be present
  +      assertTrue(loader.exists(Fqn.fromString("/a")));
   
         cache.get("/a/1", "test");// activate node
         assertFalse(loader.exists(Fqn.fromString("/a/1")));
  @@ -1636,16 +1636,4 @@
            }
         }
      }
  -
  -
  -   public static Test suite()
  -   {
  -      return new TestSuite(PassivationTestsBase.class);
  -   }
  -
  -   public static void main(String[] args)
  -   {
  -      junit.textui.TestRunner.run(suite());
  -   }
  -
   }
  
  
  
  1.9       +2 -2      JBossCache/tests/functional/org/jboss/cache/passivation/PassivationActivationCallbacksTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: PassivationActivationCallbacksTestCase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/passivation/PassivationActivationCallbacksTestCase.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- PassivationActivationCallbacksTestCase.java	2 Jul 2007 10:20:39 -0000	1.8
  +++ PassivationActivationCallbacksTestCase.java	17 Jul 2007 02:03:26 -0000	1.9
  @@ -22,7 +22,6 @@
   import org.jboss.cache.loader.CacheLoader;
   import org.jboss.cache.loader.DummyInMemoryCacheLoader;
   import org.jboss.cache.lock.IsolationLevel;
  -import org.jboss.cache.misc.TestingUtil;
   import org.jboss.cache.notifications.annotation.NodeActivated;
   import org.jboss.cache.notifications.annotation.NodePassivated;
   import org.jboss.cache.notifications.event.NodeEvent;
  @@ -123,7 +122,8 @@
         Fqn fqn = new Fqn(BASE, "bean1");
         cache.put(fqn, "bean", "A bean");
   
  -      TestingUtil.sleepThread(3000);
  +      //TestingUtil.sleepThread(3000);
  +      cache.evict(fqn, false);
   
         assertNull("No activation exception", listener.activationException);
         assertNull("No passivation exception", listener.passivationException);
  
  
  
  1.1      date: 2007/07/17 02:03:26;  author: msurtani;  state: Exp;JBossCache/tests/functional/org/jboss/cache/passivation/PassivationToDummyInMemoryCacheLoaderTest.java
  
  Index: PassivationToDummyInMemoryCacheLoaderTest.java
  ===================================================================
  package org.jboss.cache.passivation;
  
  import org.jboss.cache.config.CacheLoaderConfig;
  import org.jboss.cache.loader.DummyInMemoryCacheLoader;
  
  public class PassivationToDummyInMemoryCacheLoaderTest extends PassivationTestsBase
  {
     protected void configureCache() throws Exception
     {
        CacheLoaderConfig clc = new CacheLoaderConfig();
        cache.getConfiguration().setCacheLoaderConfig(clc);
        CacheLoaderConfig.IndividualCacheLoaderConfig iclc = new CacheLoaderConfig.IndividualCacheLoaderConfig();
        clc.setPassivation(true);
        clc.addIndividualCacheLoaderConfig(iclc);
        iclc.setClassName(DummyInMemoryCacheLoader.class.getName());
        iclc.setProperties("debug=true");
     }
  }
  
  
  



More information about the jboss-cvs-commits mailing list