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

Manik Surtani msurtani at jboss.com
Mon Aug 14 13:20:35 EDT 2006


  User: msurtani
  Date: 06/08/14 13:20:35

  Modified:    tests/functional/org/jboss/cache  FqnTest.java
  Log:
  Restored some basic cache functionality (at last!)
  
  Revision  Changes    Path
  1.12      +17 -11    JBossCache/tests/functional/org/jboss/cache/FqnTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: FqnTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/FqnTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- FqnTest.java	20 Jul 2006 09:03:55 -0000	1.11
  +++ FqnTest.java	14 Aug 2006 17:20:35 -0000	1.12
  @@ -11,13 +11,15 @@
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
   import org.jgroups.util.Util;
  +import org.jboss.cache.config.Configuration;
  +import org.jboss.cache.factories.DefaultCacheFactory;
   
   import java.util.HashMap;
   
   /**
    * Tests {@link Fqn}.
    * @author <a href="mailto:bela at jboss.org">Bela Ban</a> May 9, 2003
  - * @version $Revision: 1.11 $
  + * @version $Revision: 1.12 $
    */
   public class FqnTest extends TestCase {
   
  @@ -275,18 +277,22 @@
      public void testRemovalNonString() throws Exception
      {
          Fqn f = new Fqn(new Object[] {"test", new Integer(1)});
  -       TreeCache tc = new TreeCache();
  -       tc.getConfiguration().setCacheMode("LOCAL");
  -       tc.startService();
  -
  -       tc.put(f, "key",  "value");
  -       assertEquals("value", tc.get(f, "key"));
  -       assertTrue(tc.exists(f));
  +//       TreeCache tc = new TreeCache();
  +//       tc.getConfiguration().setCacheMode("LOCAL");
  +//       tc.startService();
  +       Configuration c = new Configuration();
  +       c.setCacheMode("LOCAL");
  +       Cache cache = new DefaultCacheFactory().createCache(c);
  +
  +       cache.put(f, "key",  "value");
   
  -       tc.remove(f);
  +       assertEquals("value", cache.get(f, "key"));
  +       assertTrue(cache.hasChild(f));
   
  -       assertNull(tc.get(f, "key"));
  -       assertFalse(tc.exists(f));
  +       cache.removeNode(f);
  +
  +       assertNull(cache.get(f, "key"));
  +       assertFalse(cache.hasChild(f));
      }
   
   
  
  
  



More information about the jboss-cvs-commits mailing list