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

Manik Surtani msurtani at jboss.com
Tue Feb 27 12:27:45 EST 2007


  User: msurtani
  Date: 07/02/27 12:27:45

  Modified:    tests/functional/org/jboss/cache/passivation 
                        ConcurrentPassivationTest.java
  Log:
  JBCACHE-814
  
  Revision  Changes    Path
  1.12      +11 -7     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.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- ConcurrentPassivationTest.java	7 Feb 2007 22:06:43 -0000	1.11
  +++ ConcurrentPassivationTest.java	27 Feb 2007 17:27:45 -0000	1.12
  @@ -22,12 +22,15 @@
    * Tests cache behavior in the presence of concurrent passivation.
    *
    * @author Brian Stansberry
  - * @version $Revision: 1.11 $
  + * @version $Revision: 1.12 $
    */
   public class ConcurrentPassivationTest extends TestCase
   {
      private CacheImpl cache_;
      private int wakeupIntervalMillis_ = 0;
  +   private String tmpDir = System.getProperty("java.io.tmpdir", "/tmp");
  +   private String cacheLoaderDir = "/JBossCacheFileCacheLoader";
  +
   
      public ConcurrentPassivationTest(String s)
      {
  @@ -48,13 +51,13 @@
   
      void initCaches() throws Exception
      {
  -      TestingUtil.recursiveFileRemove("/tmp/JBossCacheFileCacheLoader");
  +      TestingUtil.recursiveFileRemove(tmpDir + cacheLoaderDir);
         cache_ = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
         cache_.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/local-passivation-service.xml"));// read in generic local xml
         cache_.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
   
         // hack in the path to the file store in the cache loaders
  -      injectCacheLoaderLocation(cache_.getConfiguration(), "/tmp/JBossCacheFileCacheLoader");
  +      injectCacheLoaderLocation(cache_.getConfiguration(), tmpDir + cacheLoaderDir);
         cache_.start();
      }
   
  @@ -70,7 +73,7 @@
      public void tearDown() throws Exception
      {
         super.tearDown();
  -      TestingUtil.recursiveFileRemove("/tmp/JBossCacheFileCacheLoader");
  +      TestingUtil.recursiveFileRemove(tmpDir + cacheLoaderDir);
         cache_.stop();
         cache_ = null;
      }
  @@ -88,15 +91,16 @@
   
         // Loop for long enough to have 5 runs of the eviction thread
         long loopDone = System.currentTimeMillis() + (5 * wakeupIntervalMillis_);
  +
  +      System.out.println("Initialised; Loop for " + (5 * wakeupIntervalMillis_) + " millis");
  +
         while (System.currentTimeMillis() < loopDone)
         {
            // If any get returns null, that's a failure
            for (int i = 0; i < 35000; i++)
            {
               Fqn fqn = new Fqn(base, i / 100);
  -            Integer key = i;
  -            assertNotNull("found value under Fqn " + fqn + " and key " + key,
  -                    cache_.get(fqn, key));
  +            assertNotNull("Get on Fqn " + fqn + " returned null", cache_.get(fqn));
            }
         }
      }
  
  
  



More information about the jboss-cvs-commits mailing list