[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/mgmt ...
Manik Surtani
msurtani at jboss.com
Tue Jul 18 06:50:47 EDT 2006
User: msurtani
Date: 06/07/18 06:50:47
Modified: tests/functional/org/jboss/cache/mgmt NotificationTest.java
Log:
Checked in new Habanero interfaces
Updated codebase to deal with new interfaces
Revision Changes Path
1.4 +17 -29 JBossCache/tests/functional/org/jboss/cache/mgmt/NotificationTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NotificationTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/mgmt/NotificationTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- NotificationTest.java 15 Jun 2006 23:35:28 -0000 1.3
+++ NotificationTest.java 18 Jul 2006 10:50:47 -0000 1.4
@@ -3,29 +3,31 @@
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.jboss.cache.AbstractCacheListener;
+import org.jboss.cache.CacheListener;
+import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
import org.jboss.cache.PropertyConfigurator;
import org.jboss.cache.TreeCache;
-import org.jboss.cache.TreeCacheListener;
import org.jboss.cache.interceptors.CacheMgmtInterceptor;
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.xml.XmlHelper;
import org.w3c.dom.Element;
-import org.jgroups.View;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
import javax.management.Notification;
import javax.management.NotificationListener;
import javax.management.ObjectName;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
-import java.util.ArrayList;
+import java.util.Map;
/**
* Functional tests for CacheMgmtInterceptor broadcast of cache event notifications
* @author Jerry Gauthier
- * @version $Id: NotificationTest.java,v 1.3 2006/06/15 23:35:28 msurtani Exp $
+ * @version $Id: NotificationTest.java,v 1.4 2006/07/18 10:50:47 msurtani Exp $
*/
public class NotificationTest extends TestCase
{
@@ -156,52 +158,38 @@
assertNotNull("MBeanServer is null.", m_server);
assertNotNull("Cache is null.", cache);
- TreeCacheListener listener = new TreeCacheListener()
- {
-
- public void nodeCreated(Fqn fqn)
+ CacheListener listener = new AbstractCacheListener()
{
- notifications.add("Created " + fqn);
- }
-
- public void nodeRemoved(Fqn fqn)
+ public void nodeCreated(Fqn fqn, boolean pre, boolean isLocal)
{
- notifications.add("Removed " + fqn);
+ if (!pre) notifications.add("Created " + fqn);
}
- public void nodeLoaded(Fqn fqn)
+ public void nodeModified(Fqn fqn, boolean pre, boolean isLocal, Map data)
{
- notifications.add("Loaded " + fqn);
+ if (!pre) notifications.add("Modified " + fqn);
}
- public void nodeEvicted(Fqn fqn)
+ public void nodeRemoved(Fqn fqn, boolean pre, boolean isLocal, Map data)
{
- notifications.add("Evicted " + fqn);
+ if (!pre) notifications.add("Removed " + fqn);
}
- public void nodeModified(Fqn fqn)
+ public void nodeVisited(Fqn fqn, boolean pre)
{
- notifications.add("Modified " + fqn);
+ if (!pre) notifications.add("Visited " + fqn);
}
- public void nodeVisited(Fqn fqn)
- {
- notifications.add("Visited " + fqn);
- }
-
- public void cacheStarted(TreeCache cache)
+ public void cacheStarted(CacheSPI cache)
{
notifications.add("Started");
}
- public void cacheStopped(TreeCache cache)
+ public void cacheStopped(CacheSPI cache)
{
notifications.add("Stopped");
}
- public void viewChange(View new_view) // might be MergeView after merging
- {
- }
};
cache.addTreeCacheListener(listener);
More information about the jboss-cvs-commits
mailing list