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

Manik Surtani manik at jboss.org
Mon Mar 12 14:13:47 EDT 2007


  User: msurtani
  Date: 07/03/12 14:13:47

  Modified:    tests/functional/org/jboss/cache/api  CacheAPITest.java
  Log:
  JBCACHE-1005
  
  Revision  Changes    Path
  1.15      +15 -23    JBossCache/tests/functional/org/jboss/cache/api/CacheAPITest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheAPITest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/api/CacheAPITest.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -b -r1.14 -r1.15
  --- CacheAPITest.java	9 Feb 2007 17:07:45 -0000	1.14
  +++ CacheAPITest.java	12 Mar 2007 18:13:47 -0000	1.15
  @@ -3,6 +3,7 @@
   import junit.framework.TestCase;
   import org.jboss.cache.AbstractCacheListener;
   import org.jboss.cache.Cache;
  +import org.jboss.cache.CacheFactory;
   import org.jboss.cache.CacheImpl;
   import org.jboss.cache.CacheListener;
   import org.jboss.cache.DefaultCacheFactory;
  @@ -25,13 +26,14 @@
    */
   public class CacheAPITest extends TestCase
   {
  -   private Cache cache;
  +   private Cache<String, String> cache;
      protected boolean optimistic;
   
      protected void setUp() throws Exception
      {
         // start a single cache instance
  -      cache = DefaultCacheFactory.getInstance().createCache("META-INF/local-tx-service.xml", false);
  +      CacheFactory<String, String> cf = DefaultCacheFactory.getInstance();
  +      cache = cf.createCache("META-INF/local-tx-service.xml", false);
         cache.getConfiguration().setNodeLockingScheme(optimistic ? Configuration.NodeLockingScheme.OPTIMISTIC : Configuration.NodeLockingScheme.PESSIMISTIC);
         cache.start();
      }
  @@ -67,16 +69,6 @@
      }
   
      /**
  -    * Tests that getRoot() returns the same underlying object as the cache.
  -    */
  -   public void testGetRoot()
  -   {
  -      // This does not have to be true ... 
  -      // assertSame(cache, cache.getRoot());
  -   }
  -
  -
  -   /**
       * Basic usage of cache listeners
       * <p/>
       * A more complete test that tests notifications is in org.jboss.cache.notifications
  @@ -86,7 +78,7 @@
         assertEquals(0, cache.getCacheListeners().size());
   
   
  -      final List events = new ArrayList();
  +      final List<String> events = new ArrayList<String>();
   
         CacheListener dummy = new AbstractCacheListener()
         {
  @@ -162,9 +154,9 @@
       */
      public void testConvenienceMethods()
      {
  -      Fqn fqn = Fqn.fromString("/test/fqn");
  -      Object key = "key", value = "value";
  -      Map data = new HashMap();
  +      Fqn<String> fqn = Fqn.fromString("/test/fqn");
  +      String key = "key", value = "value";
  +      Map<String, String> data = new HashMap<String, String>();
         data.put(key, value);
   
         assertNull(cache.get(fqn, key));
  @@ -191,7 +183,7 @@
      public void nodeConvenienceNodeRemoval()
      {
         // this fqn is relative, but since it is from the root it may as well be absolute
  -      Fqn fqn = Fqn.fromString("/test/fqn");
  +      Fqn<String> fqn = Fqn.fromString("/test/fqn");
         cache.getRoot().addChild(fqn);
         assertTrue(cache.getRoot().hasChild(fqn));
   
  @@ -205,9 +197,9 @@
       */
      public void testEvict()
      {
  -      Fqn one = Fqn.fromString("/one");
  -      Fqn two = Fqn.fromString("/one/two");
  -      Object key = "key", value = "value";
  +      Fqn<String> one = Fqn.fromString("/one");
  +      Fqn<String> two = Fqn.fromString("/one/two");
  +      String key = "key", value = "value";
   
         cache.getRoot().addChild(one).put(key, value);
         cache.getRoot().addChild(two).put(key, value);
  @@ -245,9 +237,9 @@
       */
      public void testEvictRecursive()
      {
  -      Fqn one = Fqn.fromString("/one");
  -      Fqn two = Fqn.fromString("/one/two");
  -      Object key = "key", value = "value";
  +      Fqn<String> one = Fqn.fromString("/one");
  +      Fqn<String> two = Fqn.fromString("/one/two");
  +      String key = "key", value = "value";
   
         cache.getRoot().addChild(one).put(key, value);
         cache.getRoot().addChild(two).put(key, value);
  
  
  



More information about the jboss-cvs-commits mailing list