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

Manik Surtani msurtani at jboss.com
Wed Dec 20 08:34:28 EST 2006


  User: msurtani
  Date: 06/12/20 08:34:28

  Modified:    tests/functional/org/jboss/cache/eviction 
                        ConcurrentEvictionTest.java
  Log:
  Added sufficient clean ups to unit tests
  
  Revision  Changes    Path
  1.5       +4 -29     JBossCache/tests/functional/org/jboss/cache/eviction/ConcurrentEvictionTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ConcurrentEvictionTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/eviction/ConcurrentEvictionTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- ConcurrentEvictionTest.java	14 Nov 2006 14:17:10 -0000	1.4
  +++ ConcurrentEvictionTest.java	20 Dec 2006 13:34:28 -0000	1.5
  @@ -13,14 +13,13 @@
   import org.jboss.cache.Fqn;
   import org.jboss.cache.TreeCache;
   import org.jboss.cache.factories.XmlConfigurationParser;
  -
  -import java.io.File;
  +import org.jboss.cache.misc.TestingUtil;
   
   /**
    * Tests cache behavior in the presence of concurrent passivation.
    *
    * @author Brian Stansberry
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public class ConcurrentEvictionTest extends TestCase
   {
  @@ -44,7 +43,7 @@
   
      void initCaches() throws Exception
      {
  -      removeStaleFiles();
  +      TestingUtil.recursiveFileRemove("/tmp/JBossCacheFileCacheLoader");
         cache_ = new TreeCache();
         cache_.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/local-eviction-cacheloader-service.xml")); // read in generic local xml
         cache_.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
  @@ -54,35 +53,11 @@
      public void tearDown() throws Exception
      {
         super.tearDown();
  -      removeStaleFiles();
  +      TestingUtil.recursiveFileRemove("/tmp/JBossCacheFileCacheLoader");
         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 testConcurrentEviction() throws Exception
      {
         Fqn base = Fqn.fromString("/org/jboss/test/data/concurrent/eviction");
  
  
  



More information about the jboss-cvs-commits mailing list