[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/optimistic ...
Manik Surtani
manik at jboss.org
Thu Jun 28 12:53:38 EDT 2007
User: msurtani
Date: 07/06/28 12:53:38
Modified: tests/functional/org/jboss/cache/optimistic
AbstractOptimisticTestCase.java
NodeInterceptorRemoveNodeTest.java
TestListener.java
Log:
Notification changes
Revision Changes Path
1.51 +29 -30 JBossCache/tests/functional/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AbstractOptimisticTestCase.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- AbstractOptimisticTestCase.java 14 Jun 2007 15:30:16 -0000 1.50
+++ AbstractOptimisticTestCase.java 28 Jun 2007 16:53:38 -0000 1.51
@@ -6,7 +6,6 @@
import junit.framework.TestCase;
import org.jboss.cache.Cache;
import org.jboss.cache.CacheImpl;
-import org.jboss.cache.CacheListener;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
@@ -77,7 +76,7 @@
return createCacheWithListener(new TestListener());
}
- protected CacheImpl createCacheWithListener(CacheListener listener) throws Exception
+ protected CacheImpl createCacheWithListener(Object listener) throws Exception
{
CacheImpl cache = createCacheUnstarted();
cache.create();
1.22 +0 -6 JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorRemoveNodeTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NodeInterceptorRemoveNodeTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorRemoveNodeTest.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- NodeInterceptorRemoveNodeTest.java 15 Jun 2007 12:54:09 -0000 1.21
+++ NodeInterceptorRemoveNodeTest.java 28 Jun 2007 16:53:38 -0000 1.22
@@ -13,7 +13,6 @@
import org.jboss.cache.interceptors.CallInterceptor;
import org.jboss.cache.interceptors.Interceptor;
import org.jboss.cache.loader.SamplePojo;
-import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.OptimisticTransactionEntry;
import org.jboss.cache.transaction.TransactionTable;
@@ -32,7 +31,6 @@
private TestListener listener;
private MockInterceptor dummy;
private TransactionManager mgr;
- private static final int LISTENER_WAIT_TIME = 200; // needed since notifications are delivered asynchronously
/**
* @param name
@@ -101,7 +99,6 @@
assertEquals(1, entry.getModifications().size());
assertTrue(!cache.exists("/one/two"));
assertEquals(null, dummy.getCalled());
- TestingUtil.sleepThread(LISTENER_WAIT_TIME);
assertEquals(0, listener.getNodesAdded());
}
@@ -314,7 +311,6 @@
assertEquals(3, entry.getModifications().size());
assertEquals(null, dummy.getCalled());
- TestingUtil.sleepThread(LISTENER_WAIT_TIME);
assertEquals(4, listener.getNodesAdded());
}
@@ -384,7 +380,6 @@
assertEquals(3, entry.getModifications().size());
assertTrue(!cache.exists("/one/two"));
assertEquals(null, dummy.getCalled());
- TestingUtil.sleepThread(LISTENER_WAIT_TIME);
assertEquals(3, listener.getNodesAdded());
}
@@ -438,7 +433,6 @@
assertEquals(2, entry.getModifications().size());
assertTrue(!cache.exists("/one/two"));
assertEquals(null, dummy.getCalled());
- TestingUtil.sleepThread(LISTENER_WAIT_TIME);
assertEquals(2, listener.getNodesAdded());
}
}
1.11 +9 -6 JBossCache/tests/functional/org/jboss/cache/optimistic/TestListener.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TestListener.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/TestListener.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- TestListener.java 30 Aug 2006 18:32:17 -0000 1.10
+++ TestListener.java 28 Jun 2007 16:53:38 -0000 1.11
@@ -8,13 +8,15 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.AbstractCacheListener;
-import org.jboss.cache.Fqn;
+import org.jboss.cache.notifications.annotation.CacheListener;
+import org.jboss.cache.notifications.annotation.NodeCreated;
+import org.jboss.cache.notifications.event.NodeEvent;
/**
* @author swoodcock
*/
-public class TestListener extends AbstractCacheListener
+ at CacheListener
+public class TestListener
{
Log log = LogFactory.getLog(getClass());
@@ -23,12 +25,13 @@
/* (non-Javadoc)
* @see org.jboss.cache.TreeCacheListener#nodeCreated(org.jboss.cache.Fqn)
*/
- public synchronized void nodeCreated(Fqn fqn, boolean pre, boolean local)
+ @NodeCreated
+ public synchronized void nodeCreated(NodeEvent e)
{
- if (pre)
+ if (e.isPre())
{
nodesAdded++;
- log.info("DataNode created " + fqn);
+ log.info("DataNode created " + e.getFqn());
}
}
More information about the jboss-cvs-commits
mailing list