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

Manik Surtani manik at jboss.org
Wed Mar 14 12:42:05 EDT 2007


  User: msurtani
  Date: 07/03/14 12:42:05

  Modified:    tests/functional/org/jboss/cache/loader 
                        AdjListJDBCCacheLoaderCompatibilityTest.java
  Log:
  Changed config used so it is not dependent on manual tests
  
  Revision  Changes    Path
  1.2       +238 -237  JBossCache/tests/functional/org/jboss/cache/loader/AdjListJDBCCacheLoaderCompatibilityTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AdjListJDBCCacheLoaderCompatibilityTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/AdjListJDBCCacheLoaderCompatibilityTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- AdjListJDBCCacheLoaderCompatibilityTest.java	5 Mar 2007 21:10:48 -0000	1.1
  +++ AdjListJDBCCacheLoaderCompatibilityTest.java	14 Mar 2007 16:42:05 -0000	1.2
  @@ -1,24 +1,23 @@
   package org.jboss.cache.loader;
   
  -import org.jboss.cache.factories.XmlConfigurationParser;
  -import org.jboss.cache.xml.XmlHelper;
  -import org.jboss.cache.config.CacheLoaderConfig;
  +import junit.framework.TestCase;
   import org.jboss.cache.CacheImpl;
   import org.jboss.cache.DefaultCacheFactory;
   import org.jboss.cache.Fqn;
  +import org.jboss.cache.config.CacheLoaderConfig;
  +import org.jboss.cache.factories.XmlConfigurationParser;
   import org.jboss.cache.marshall.NodeData;
   import org.jboss.cache.statetransfer.StateTransferManager;
  -import org.jboss.util.stream.MarshalledValueOutputStream;
  +import org.jboss.cache.xml.XmlHelper;
   import org.jboss.util.stream.MarshalledValueInputStream;
  +import org.jboss.util.stream.MarshalledValueOutputStream;
   import org.w3c.dom.Element;
   
  -import java.util.Properties;
  +import java.io.ByteArrayInputStream;
  +import java.io.ByteArrayOutputStream;
   import java.util.ArrayList;
   import java.util.HashSet;
  -import java.io.ByteArrayOutputStream;
  -import java.io.ByteArrayInputStream;
  -
  -import junit.framework.TestCase;
  +import java.util.Properties;
   
   /**
    * Tests the compatibility between <tt>JDBCCacheLoader</tt> and <tt>JDBCCacheLoaderOld</tt>. More exactly,
  @@ -39,6 +38,7 @@
       /**
        * Note : newImpl is not started here but in each individual test. That's because on start it performs
        * some backward compatibility logic.
  +    *
        * @see JDBCCacheLoader#start()
        */
       protected void setUp() throws Exception
  @@ -120,15 +120,16 @@
           ByteArrayInputStream bais = new ByteArrayInputStream(newBaos.toByteArray());
           MarshalledValueInputStream is = new MarshalledValueInputStream(bais);
           newImpl.storeEntireState(is);
  -        assertEquals(newImpl.get(Fqn.fromString("/a/b/c")).get("key1"),"value1");
  -        assertEquals(newImpl.get(Fqn.fromString("/a/b/d")).get("key2"),"value2");
  -        assertEquals(newImpl.get(Fqn.fromString("/a/b/e")).get("key3"),"value3");
  -        assertEquals(newImpl.get(Fqn.fromString("/a/f/e")).get("key4"),"value4");
  -        assertEquals(newImpl.get(Fqn.ROOT).get("root_key"),"root_value");
  +      assertEquals(newImpl.get(Fqn.fromString("/a/b/c")).get("key1"), "value1");
  +      assertEquals(newImpl.get(Fqn.fromString("/a/b/d")).get("key2"), "value2");
  +      assertEquals(newImpl.get(Fqn.fromString("/a/b/e")).get("key3"), "value3");
  +      assertEquals(newImpl.get(Fqn.fromString("/a/f/e")).get("key4"), "value4");
  +      assertEquals(newImpl.get(Fqn.ROOT).get("root_key"), "root_value");
           assertEquals(newImpl.getNodeCount(), 8);
       }
   
  -    public void testLoadNodeState() throws Exception {
  +   public void testLoadNodeState() throws Exception
  +   {
           oldImpl.put(Fqn.fromString("/a/b/c"), "key1", "value1");
           oldImpl.put(Fqn.fromString("/a/b/d"), "key2", "value2");
           oldImpl.put(Fqn.fromString("/a/b/e"), "key3", "value3");
  @@ -152,11 +153,11 @@
           MarshalledValueInputStream is = new MarshalledValueInputStream(bais);
           newImpl.storeState(Fqn.fromString("/a/b"), is);
   
  -        assertEquals(newImpl.get(Fqn.fromString("/a/b/c")).get("key1"),"value1");
  -        assertEquals(newImpl.get(Fqn.fromString("/a/b/d")).get("key2"),"value2");
  -        assertEquals(newImpl.get(Fqn.fromString("/a/b/e")).get("key3"),"value3");
  -        assertEquals(newImpl.get(Fqn.fromString("/a/f/e")).get("key4"),"value4");
  -        assertEquals(newImpl.get(Fqn.ROOT).get("root_key"),"root_value");
  +      assertEquals(newImpl.get(Fqn.fromString("/a/b/c")).get("key1"), "value1");
  +      assertEquals(newImpl.get(Fqn.fromString("/a/b/d")).get("key2"), "value2");
  +      assertEquals(newImpl.get(Fqn.fromString("/a/b/e")).get("key3"), "value3");
  +      assertEquals(newImpl.get(Fqn.fromString("/a/f/e")).get("key4"), "value4");
  +      assertEquals(newImpl.get(Fqn.ROOT).get("root_key"), "root_value");
           assertEquals(newImpl.getNodeCount(), 8);
       }
   
  @@ -164,7 +165,8 @@
        * getNodeDataList is a template method on which the serialisation process relies. We check here that the new
        * implementation works exactelly as the old one.
        */
  -    public void testGetNodeData() throws Exception {
  +   public void testGetNodeData() throws Exception
  +   {
           oldImpl.put(Fqn.fromString("/a/b/c"), "key1", "value1");
           oldImpl.put(Fqn.fromString("/a/b/d"), "key2", "value2");
           oldImpl.put(Fqn.fromString("/a/b/e"), "key3", "value3");
  @@ -191,7 +193,6 @@
       }
   
   
  -
       protected CacheLoaderConfig getSingleCacheLoaderConfig(String preload, String cacheloaderClass, String properties) throws Exception
       {
           String xml = "<config>\n" +
  @@ -253,8 +254,8 @@
                   "cache.jdbc.user=" + prop.getProperty("cache.jdbc.user") + "\n" +
                   "cache.jdbc.password=" + prop.getProperty("cache.jdbc.password") + "\n" +
                   "cache.jdbc.node.type=" + prop.getProperty("cache.jdbc.node.type") + "\n" +
  -                "cache.jdbc.sql-concat=" + prop.getProperty("cache.jdbc.sql-concat") + "\n" +
  -                "cache.jdbc.connection.factory=org.jboss.cache.manualtests.cacheloader.OneConnectionFactory";
  +              "cache.jdbc.sql-concat=" + prop.getProperty("cache.jdbc.sql-concat");// + "\n" +
  +//                "cache.jdbc.connection.factory=org.jboss.cache.manualtests.cacheloader.OneConnectionFactory";
   
   
           CacheLoaderConfig.IndividualCacheLoaderConfig base = getSingleCacheLoaderConfig("", "org.jboss.cache.loader.JDBCCacheLoader", props).getFirstCacheLoaderConfig();
  
  
  



More information about the jboss-cvs-commits mailing list