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

Ben Wang bwang at jboss.com
Sun Sep 17 03:49:16 EDT 2006


  User: bwang   
  Date: 06/09/17 03:49:16

  Modified:    tests-50/functional/org/jboss/cache/pojo/collection 
                        CachedMapTest.java
  Log:
  JIRA JBCACHE-765 Collection equals
  
  Revision  Changes    Path
  1.4       +34 -3     JBossCache/tests-50/functional/org/jboss/cache/pojo/collection/CachedMapTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CachedMapTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests-50/functional/org/jboss/cache/pojo/collection/CachedMapTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- CachedMapTest.java	8 Sep 2006 07:55:58 -0000	1.3
  +++ CachedMapTest.java	17 Sep 2006 07:49:16 -0000	1.4
  @@ -196,7 +196,7 @@
         assertFalse("does not contain squash", hobbies.containsValue("squash"));
      }
   
  -   public void testEquals() throws Throwable
  +   public void testEquals1() throws Throwable
      {
         Map map = new HashMap();
         map.put("1", "test");
  @@ -205,6 +205,38 @@
         assertFalse("Map should not be the same ", map.equals(hobbies));
      }
   
  +   public void testEquals2() throws Throwable
  +   {
  +      Map map1 = new HashMap();
  +      cache_.attach("map1", map1);
  +      map1 = (Map)cache_.find("map1");
  +      map1.put("1", "test");
  +
  +      Map map2 = new HashMap();
  +      cache_.attach("map2", map2);
  +      map2 = (Map)cache_.find("map2");
  +      map2.put("1", "me");
  +
  +      assertFalse("Map should not be the same ", map1.equals(map2));
  +   }
  +
  +   public void testEquals3() throws Throwable
  +   {
  +      Map map1 = new HashMap();
  +      cache_.attach("map1", map1);
  +      map1 = (Map)cache_.find("map1");
  +      map1.put("1", "test");
  +      map1.put("2", "test");
  +
  +      Map map2 = new HashMap();
  +      cache_.attach("map2", map2);
  +      map2 = (Map)cache_.find("map2");
  +      map2.put("1", "me");
  +      map2.put("2", "me");
  +
  +      assertFalse("Map should not be the same ", map1.equals(map2));
  +   }
  +
      public void testAttachAndDetach() throws Exception
      {
         Map map = new HashMap();
  @@ -268,6 +300,7 @@
         map.remove("2");
         assertEquals("Size ", 2, map.size());
      }
  +
      public void testKeyAsObject() throws Exception
      {
         SerializableKeyValue key = new SerializableKeyValue(42,"Novell");
  @@ -326,8 +359,6 @@
               t = t.getCause();
            assertTrue("we got expected RuntimeException, test that cause is java.io.NotSerializableException, t.getCause()= "+t.getCause().getClass().getName(), t.getCause() instanceof java.io.NotSerializableException);
         }
  -
  -
      }
   
      public static Test suite() throws Exception
  
  
  



More information about the jboss-cvs-commits mailing list