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

Manik Surtani msurtani at belmont.prod.atl2.jboss.com
Wed Aug 30 15:09:56 EDT 2006


  User: msurtani
  Date: 06/08/30 15:09:56

  Modified:    tests/functional/org/jboss/cache/loader  
                        CacheLoaderPurgingTest.java DummyCacheLoader.java
  Log:
  removed unnenessary (IDE-generated) TODOs that were becoming noisy
  refactored identity lock constructors
  
  Revision  Changes    Path
  1.3       +113 -115  JBossCache/tests/functional/org/jboss/cache/loader/CacheLoaderPurgingTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheLoaderPurgingTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/CacheLoaderPurgingTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- CacheLoaderPurgingTest.java	20 Jul 2006 08:05:18 -0000	1.2
  +++ CacheLoaderPurgingTest.java	30 Aug 2006 19:09:56 -0000	1.3
  @@ -13,8 +13,6 @@
   import org.jboss.cache.xml.XmlHelper;
   
   /**
  - * //TODO: MANIK: Javadoc this class
  - *
    * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
    */
   public class CacheLoaderPurgingTest extends AbstractCacheLoaderTestBase
  @@ -38,7 +36,7 @@
           cache = new TreeCache();
           Configuration c = new Configuration();
           cache.setConfiguration(c);
  -        c.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location=" + System.getProperty("java.io.tmpdir", "/tmp")+ "/" + "CacheLoaderPurgingTest", false, false, false));
  +      c.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location=" + System.getProperty("java.io.tmpdir", "/tmp") + "/" + "CacheLoaderPurgingTest", false, false, false));
           cache.startService();
   
           cache.put(fqn, key, value);
  @@ -62,7 +60,7 @@
           cache = new TreeCache();
           Configuration c = new Configuration();
           cache.setConfiguration(c);
  -        c.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location=" + System.getProperty("java.io.tmpdir", "/tmp") +"/" + "CacheLoaderPurgingTest", false, false, false, true));
  +      c.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location=" + System.getProperty("java.io.tmpdir", "/tmp") + "/" + "CacheLoaderPurgingTest", false, false, false, true));
           cache.startService();
   
           cache.put(fqn, key, value);
  @@ -95,7 +93,7 @@
                   "</properties>\n" +
                   "<async>false</async>\n" +
                   "<fetchPersistentState>true</fetchPersistentState>\n" +
  -                "<purgeOnStartup>"+true+"</purgeOnStartup>\n" +
  +              "<purgeOnStartup>" + true + "</purgeOnStartup>\n" +
                   "</cacheloader>\n" +
                   "<cacheloader>\n" +
                   "<class>org.jboss.cache.loader.FileCacheLoader</class>\n" +
  @@ -115,7 +113,7 @@
   
           cache.put(fqn, key, value);
   
  -        CacheLoader loader[] = (CacheLoader[]) ((ChainingCacheLoader)cache.getCacheLoader()).getCacheLoaders().toArray(new CacheLoader[]{});
  +      CacheLoader loader[] = (CacheLoader[]) ((ChainingCacheLoader) cache.getCacheLoader()).getCacheLoaders().toArray(new CacheLoader[]{});
   
           assertEquals(value, cache.get(fqn, key));
           assertEquals(value, loader[0].get(fqn).get(key));
  
  
  
  1.4       +271 -272  JBossCache/tests/functional/org/jboss/cache/loader/DummyCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: DummyCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/DummyCacheLoader.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- DummyCacheLoader.java	19 Jul 2006 08:29:19 -0000	1.3
  +++ DummyCacheLoader.java	30 Aug 2006 19:09:56 -0000	1.4
  @@ -208,9 +208,12 @@
        */
       public void prepare(Object tx, List<Modification> modifications, boolean one_phase) throws Exception
       {
  -        if (one_phase) {
  +      if (one_phase)
  +      {
               put(modifications);
  -        } else {
  +      }
  +      else
  +      {
               m_transactions.put(tx, modifications);
           }
       }
  @@ -227,7 +230,8 @@
       public void commit(Object tx) throws Exception
       {
           List modifications = (List) m_transactions.get(tx);
  -        if (modifications == null) {
  +      if (modifications == null)
  +      {
               return;
           }
           put(modifications);
  @@ -243,18 +247,13 @@
       public void rollback(Object tx)
       {
            List modifications = (List) m_transactions.get(tx);
  -        if (modifications == null) {
  +      if (modifications == null)
  +      {
               return;
           }
           m_transactions.remove(tx);
       }
   
  -    /**
  -     * Fetch the entire state for this cache from secondary storage (disk, DB) and return it as a byte buffer.
  -     * This is for initialization of a new cache from a remote cache. The new cache would then call
  -     * storeEntireState().<br/>
  -     * todo: define binary format for exchanging state
  -     */
       public byte[] loadEntireState() throws Exception
       {
           return new byte[0];
  
  
  



More information about the jboss-cvs-commits mailing list