From: Scott M. <sm...@no...> - 2005-09-02 18:32:46
|
User: smarlow Date: 05/09/02 14:32:41 Modified: tests/functional/org/jboss/cache TreeCacheListenerTest.java Log: Jira # JBCACHE-261 We need to enhance the TreeCache to have knowledge of whether a TreeCache modification occured locally or remotely. This will allow the DistributedState implementation to provide the information required for the DSListener support. Revision Changes Path 1.4 +15 -11 JBossCache/tests/functional/org/jboss/cache/TreeCacheListenerTest.java (In the diff below, changes in quantity of whitespace are not shown.) Index: TreeCacheListenerTest.java =================================================================== RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/TreeCacheListenerTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -b -r1.3 -r1.4 --- TreeCacheListenerTest.java 25 Aug 2005 19:55:33 -0000 1.3 +++ TreeCacheListenerTest.java 2 Sep 2005 18:32:41 -0000 1.4 @@ -24,7 +24,7 @@ /** * @author <a href="mailto:ju...@jb...">Julien Viet</a> - * @version $Id: TreeCacheListenerTest.java,v 1.3 2005/08/25 19:55:33 hmesha Exp $ + * @version $Id: TreeCacheListenerTest.java,v 1.4 2005/09/02 18:32:41 smarlow Exp $ */ public class TreeCacheListenerTest extends TestCase { @@ -66,7 +66,7 @@ cache.remove("/", "name"); tm.commit(); - assertEquals(Arrays.asList(new Object[]{"modified /"}), el.events); + assertEquals(Arrays.asList(new Object[]{"modify about to modify local /","modified /", "modify Modified local /"}), el.events); } public void testRemoveNodeWithRollback() throws Exception @@ -81,7 +81,7 @@ cache.remove("/child"); tm.rollback(); - assertEquals(Arrays.asList(new Object[]{"removed /child","created /child"}), el.events); + assertEquals(Arrays.asList(new Object[]{"remove about to remove local /child","removed /child","remove Removed local /child","created /child"}), el.events); } public static class EventLog extends AbstractTreeCacheListener @@ -91,6 +91,12 @@ { events.add("created " + fqn); } + public void nodeRemove(Fqn fqn, boolean pre, boolean isLocal) + { + events.add("remove "+ + (pre? "about to remove " : "Removed ") + + (isLocal? "local " : "remote ") + fqn); + } public void nodeRemoved(Fqn fqn) { events.add("removed " + fqn); @@ -103,6 +109,12 @@ { throw new UnsupportedOperationException(); } + public void nodeModify(Fqn fqn, boolean pre, boolean isLocal) + { + events.add("modify "+ + (pre? "about to modify " : "Modified ") + + (isLocal? "local " : "remote ") + fqn); + } public void nodeModified(Fqn fqn) { events.add("modified " + fqn); @@ -123,14 +135,6 @@ { throw new UnsupportedOperationException(); } - public void nodeRemove(Fqn fqn, boolean pre) - { - if (pre) { - events.add("about to remove " + fqn); - } else { - events.add("Removed " + fqn); - } - } } |