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

Ben Wang bwang at jboss.com
Mon Oct 30 02:50:59 EST 2006


  User: bwang   
  Date: 06/10/30 02:50:59

  Modified:    tests/functional/org/jboss/cache/notifications 
                        CacheListenerTest.java
  Log:
  Add test for put map
  
  Revision  Changes    Path
  1.7       +24 -0     JBossCache/tests/functional/org/jboss/cache/notifications/CacheListenerTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheListenerTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/notifications/CacheListenerTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- CacheListenerTest.java	18 Oct 2006 15:00:49 -0000	1.6
  +++ CacheListenerTest.java	30 Oct 2006 07:50:59 -0000	1.7
  @@ -168,6 +168,30 @@
         assertEquals(expected, eventLog.events);
      }
   
  +   public void testPutMap() throws Exception
  +   {
  +      assertEquals("Event log should be empty", Collections.emptyList(), eventLog.events);
  +      Map oldData = new HashMap();
  +      oldData.put("key", "value");
  +      oldData.put("key2", "value2");
  +
  +      // clear event log
  +      eventLog.events.clear();
  +      assertEquals("Event log should be empty", Collections.emptyList(), eventLog.events);
  +
  +      // modify existing node
  +      cache.put(fqn, oldData);
  +
  +      //expected
  +      List<Event> expected = new ArrayList<Event>();
  +      expected.add(new Event(ListenerMethod.NODE_CREATED, fqn, true, true, null));
  +      expected.add(new Event(ListenerMethod.NODE_CREATED, fqn, false, true, null));
  +      expected.add(new Event(ListenerMethod.NODE_MODIFIED, fqn, true, true, Collections.emptyMap()));
  +      expected.add(new Event(ListenerMethod.NODE_MODIFIED, fqn, false, true, oldData));
  +
  +      assertEquals(expected, eventLog.events);
  +   }
  +
      public void testMove()
      {
         assertEquals("Event log should be empty", Collections.emptyList(), eventLog.events);
  
  
  



More information about the jboss-cvs-commits mailing list