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

Galder Zamarreno galder.zamarreno at jboss.com
Fri Jun 29 09:33:37 EDT 2007


  User: gzamarreno
  Date: 07/06/29 09:33:37

  Modified:    tests/functional/org/jboss/cache/passivation   Tag:
                        Branch_JBossCache_1_4_0 BasicPassivationTest.java
                        ConcurrentPassivationTest.java
  Log:
  [JBCACHE-1103] Finished the backport from head.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +6 -2      JBossCache/tests/functional/org/jboss/cache/passivation/BasicPassivationTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BasicPassivationTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/passivation/BasicPassivationTest.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -b -r1.1.2.1 -r1.1.2.2
  --- BasicPassivationTest.java	7 Nov 2006 18:32:57 -0000	1.1.2.1
  +++ BasicPassivationTest.java	29 Jun 2007 13:33:37 -0000	1.1.2.2
  @@ -16,15 +16,18 @@
   import org.jboss.cache.AbstractTreeCacheListener;
   import org.jboss.cache.Node;
   import org.jboss.cache.TreeCacheListener;
  +import org.jboss.cache.loader.DummyInMemoryCacheLoader;
  +import org.jboss.cache.loader.AbstractCacheLoaderTestBase;
   import org.jboss.cache.eviction.*;
   import org.jboss.cache.misc.TestingUtil;
   
   /**
    *
    * @author Ben Wang
  - * @version $Revision: 1.1.2.1 $
  + * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
  + * @version $Revision: 1.1.2.2 $
    */
  -public class BasicPassivationTest extends TestCase
  +public class BasicPassivationTest extends AbstractCacheLoaderTestBase
   {
      TreeCache cache_;
      int wakeupIntervalMillis_ = 0;
  @@ -59,6 +62,7 @@
         cache_ = new TreeCache();
         PropertyConfigurator config = new PropertyConfigurator();
         config.configure(cache_, "META-INF/local-passivation-service.xml"); // read in generic local xml
  +      cache_.setCacheLoaderConfiguration(getSingleCacheLoaderConfig(true, "/", DummyInMemoryCacheLoader.class.getName(), null, false, true, false, false));
         cache_.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
         TreeCacheListener listener = new TestCacheListener();
         cache_.addTreeCacheListener(listener);
  
  
  
  1.1.2.4   +6 -29     JBossCache/tests/functional/org/jboss/cache/passivation/ConcurrentPassivationTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ConcurrentPassivationTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/passivation/ConcurrentPassivationTest.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -b -r1.1.2.3 -r1.1.2.4
  --- ConcurrentPassivationTest.java	2 Nov 2006 10:13:49 -0000	1.1.2.3
  +++ ConcurrentPassivationTest.java	29 Jun 2007 13:33:37 -0000	1.1.2.4
  @@ -13,6 +13,8 @@
   import org.jboss.cache.Fqn;
   import org.jboss.cache.PropertyConfigurator;
   import org.jboss.cache.TreeCache;
  +import org.jboss.cache.loader.DummyInMemoryCacheLoader;
  +import org.jboss.cache.loader.AbstractCacheLoaderTestBase;
   
   import java.io.File;
   
  @@ -20,9 +22,10 @@
    * Tests cache behavior in the presence of concurrent passivation.
    *
    * @author Brian Stansberry
  - * @version $Revision: 1.1.2.3 $
  + * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
  + * @version $Revision: 1.1.2.4 $
    */
  -public class ConcurrentPassivationTest extends TestCase
  +public class ConcurrentPassivationTest extends AbstractCacheLoaderTestBase
   {
      private TreeCache cache_;
      private int wakeupIntervalMillis_ = 0;
  @@ -44,47 +47,21 @@
   
      void initCaches() throws Exception
      {
  -      removeStaleFiles();
         cache_ = new TreeCache();
         PropertyConfigurator config = new PropertyConfigurator();
         config.configure(cache_, "META-INF/local-passivation-service.xml"); // read in generic local xml
         cache_.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  +      cache_.setCacheLoaderConfiguration(getSingleCacheLoaderConfig(true, "/", DummyInMemoryCacheLoader.class.getName(), null, false, true, false, false));
         cache_.startService();
      }
   
      public void tearDown() throws Exception
      {
         super.tearDown();
  -      removeStaleFiles();
         cache_.stop();
         cache_ = null;
      }
   
  -   private void removeStaleFiles()
  -   {
  -      File file = new File("/tmp/JBossCacheFileCacheLoader");
  -      if (file.exists())
  -      {
  -         System.out.println("Deleting file " + file);
  -         recursivedelete(file);
  -      }
  -   }
  -
  -   private void recursivedelete(File f)
  -   {
  -      if (f.isDirectory())
  -      {
  -         File[] files = f.listFiles();
  -         for (int i = 0; i < files.length; i++)
  -         {
  -            recursivedelete(files[i]);
  -         }
  -      }
  -      //System.out.println("File " + f.toURI() + " deleted = " + f.delete());
  -      f.delete();
  -   }
  -
  -
      public void testConcurrentPassivation() throws Exception
      {
         Fqn base = Fqn.fromString("/org/jboss/test/data/concurrent/passivation");
  
  
  



More information about the jboss-cvs-commits mailing list