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

Manik Surtani msurtani at jboss.com
Wed Nov 8 12:29:21 EST 2006


  User: msurtani
  Date: 06/11/08 12:29:21

  Modified:    tests/functional/org/jboss/cache/eviction 
                        ConcurrentEvictionTest.java
  Log:
  fixed setup and teardown
  
  Revision  Changes    Path
  1.3       +17 -5     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.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- ConcurrentEvictionTest.java	31 Oct 2006 17:33:36 -0000	1.2
  +++ ConcurrentEvictionTest.java	8 Nov 2006 17:29:21 -0000	1.3
  @@ -13,7 +13,6 @@
   import org.jboss.cache.Fqn;
   import org.jboss.cache.TreeCache;
   import org.jboss.cache.factories.XmlConfigurationParser;
  -import org.jboss.cache.loader.FileCacheLoaderConfig;
   
   import java.io.File;
   
  @@ -21,7 +20,7 @@
    * Tests cache behavior in the presence of concurrent passivation.
    *
    * @author Brian Stansberry
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public class ConcurrentEvictionTest extends TestCase
   {
  @@ -62,15 +61,28 @@
   
      private void removeStaleFiles()
      {
  -      File file = new File(cache_ == null ? "/tmp/JBossCacheFileCacheLoader" : ((FileCacheLoaderConfig) cache_.getCacheLoader().getConfig()).getLocation());
  +      File file = new File("/tmp/JBossCacheFileCacheLoader");
         if (file.exists())
         {
            System.out.println("Deleting file " + file);
  -         file.deleteOnExit();
  -         System.out.println(file.delete());
  +         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