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

Manik Surtani msurtani at jboss.com
Thu Jan 4 00:35:41 EST 2007


  User: msurtani
  Date: 07/01/04 00:35:41

  Modified:    tests/functional/org/jboss/cache/loader 
                        CacheLoaderManagerTest.java
  Log:
  Major changes around nodes, and the way they interact with the interceptor stack.
  Also removed redundant methods in NodeSPI and removed the need for casting to NodeSPI in most cases.
  
  Revision  Changes    Path
  1.13      +504 -504  JBossCache/tests/functional/org/jboss/cache/loader/CacheLoaderManagerTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheLoaderManagerTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/CacheLoaderManagerTest.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -b -r1.12 -r1.13
  --- CacheLoaderManagerTest.java	25 Oct 2006 04:50:19 -0000	1.12
  +++ CacheLoaderManagerTest.java	4 Jan 2007 05:35:41 -0000	1.13
  @@ -9,11 +9,11 @@
   import junit.framework.Assert;
   import junit.framework.Test;
   import junit.framework.TestSuite;
  +import org.jboss.cache.CacheListener;
  +import org.jboss.cache.CacheSPI;
   import org.jboss.cache.config.CacheLoaderConfig;
   import org.jboss.cache.factories.XmlConfigurationParser;
   import org.jboss.cache.xml.XmlHelper;
  -import org.jboss.cache.CacheSPI;
  -import org.jboss.cache.CacheListener;
   import org.w3c.dom.Element;
   
   import java.util.List;
  @@ -26,25 +26,25 @@
    */
   public class CacheLoaderManagerTest extends AbstractCacheLoaderTestBase
   {
  -    private CacheLoaderConfig createCacheLoaderCfg( boolean passivation )
  +   private CacheLoaderConfig createCacheLoaderCfg(boolean passivation)
       {
           CacheLoaderConfig cfg = new CacheLoaderConfig();
  -        cfg.setPassivation( passivation );
  +      cfg.setPassivation(passivation);
           return cfg;
       }
   
       private CacheLoaderConfig.IndividualCacheLoaderConfig createIndividualCacheLoaderConfig(CacheLoaderConfig parent, boolean async, String classname) throws Exception
       {
           CacheLoaderConfig.IndividualCacheLoaderConfig cfg = new CacheLoaderConfig.IndividualCacheLoaderConfig();
  -        cfg.setAsync( async );
  -        cfg.setClassName( classname );
  -        cfg.setFetchPersistentState( false );
  +      cfg.setAsync(async);
  +      cfg.setClassName(classname);
  +      cfg.setFetchPersistentState(false);
           Properties p = new Properties();
           p.setProperty("location", getTempDir());
           p.setProperty("cache.jdbc.driver", "com.mysql.jdbc.Driver");
           p.setProperty("cache.jdbc.url", "jdbc:mysql://localhost/test");
           p.setProperty("cache.jdbc.user", "user");
  -        p.setProperty("cache.jdbc.password","pwd");
  +      p.setProperty("cache.jdbc.password", "pwd");
           cfg.setProperties(p);
           return cfg;
       }
  @@ -110,7 +110,7 @@
       public void testSingleCacheLoaderFromXml() throws Exception
       {
           // without async
  -        CacheLoaderConfig clc = getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location="+getTempDir(), false, false, false);
  +      CacheLoaderConfig clc = getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location=" + getTempDir(), false, false, false);
   
           CacheLoaderManager mgr = new CacheLoaderManager();
           mgr.setConfig(clc, null);
  @@ -129,7 +129,7 @@
       public void testSingleCacheLoaderPassivationFromXml() throws Exception
       {
           // without async
  -        String conf = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+
  +      String conf = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
                   "<config><passivation>true</passivation>" +
                   "<cacheloader>" +
                   "    <class>org.jboss.cache.loader.FileCacheLoader</class>" +
  @@ -286,7 +286,7 @@
                   "    <fetchPersistentState>false</fetchPersistentState>" +
                   "    <ignoreModifications>false</ignoreModifications>" +
                   "    <properties>" +
  -                "cache.jdbc.driver=com.mysql.jdbc.Driver\ncache.jdbc.url=jdbc:mysql://localhost/test\ncache.jdbc.user=user\ncache.jdbc.password=pwd"+
  +              "cache.jdbc.driver=com.mysql.jdbc.Driver\ncache.jdbc.url=jdbc:mysql://localhost/test\ncache.jdbc.user=user\ncache.jdbc.password=pwd" +
                   "    </properties>" +
                   "</cacheloader></config>";
           clc = XmlConfigurationParser.parseCacheLoaderConfig(strToElement(conf));
  @@ -400,14 +400,14 @@
           Assert.assertEquals("/, /blah, /blah2", c.getPreload());
           Assert.assertEquals(2, c.getIndividualCacheLoaderConfigs().size());
   
  -        CacheLoaderConfig.IndividualCacheLoaderConfig icfg = (CacheLoaderConfig.IndividualCacheLoaderConfig) c.getIndividualCacheLoaderConfigs().get(0);
  +      CacheLoaderConfig.IndividualCacheLoaderConfig icfg = c.getIndividualCacheLoaderConfigs().get(0);
           Assert.assertEquals("org.jboss.cache.loader.FileCacheLoader", icfg.getClassName());
           Assert.assertTrue("Async shld be false", !icfg.isAsync());
           Assert.assertTrue("fetchPersistentState shld be false", !icfg.isFetchPersistentState());
           Assert.assertTrue("IgnoreMods should be true", icfg.isIgnoreModifications());
           Assert.assertEquals(1, icfg.getProperties().size());
   
  -        icfg = (CacheLoaderConfig.IndividualCacheLoaderConfig) c.getIndividualCacheLoaderConfigs().get(1);
  +      icfg = c.getIndividualCacheLoaderConfigs().get(1);
           Assert.assertEquals("org.jboss.cache.loader.JDBCCacheLoader", icfg.getClassName());
           Assert.assertTrue("Async shld be true", icfg.isAsync());
           Assert.assertTrue("fetchPersistentState shld be true", icfg.isFetchPersistentState());
  
  
  



More information about the jboss-cvs-commits mailing list