JBoss Cache SVN: r4672 - in core/trunk/src: test/java/org/jboss/cache/transaction and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-10-23 07:54:46 -0400 (Tue, 23 Oct 2007)
New Revision: 4672
Modified:
core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
core/trunk/src/test/java/org/jboss/cache/transaction/TransactionTest.java
Log:
Minor patches
Modified: core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2007-10-23 11:16:08 UTC (rev 4671)
+++ core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2007-10-23 11:54:46 UTC (rev 4672)
@@ -2225,7 +2225,7 @@
}
InvocationContext ctx = getInvocationContext();
boolean isRollback = checkIsRollingBack(ctx.getTransaction());
- NodeSPI<K, V> n = findNodeCheck(tx, fqn);
+ NodeSPI<K, V> n = findNodeCheck(tx, fqn, isRollback);
Map<K, V> rawData = n.getDataDirect();
if (!isRollback) notifier.notifyNodeModified(fqn, true, NodeModifiedEvent.ModificationType.PUT_MAP, rawData, ctx);
@@ -2292,7 +2292,7 @@
// if this is a rollback then don't fire notifications.
boolean isRollback = checkIsRollingBack(ctx.getTransaction());
- NodeSPI<K, V> n = findNodeCheck(tx, fqn);
+ NodeSPI<K, V> n = findNodeCheck(tx, fqn, isRollback);
Map<K, V> rawData = n.getDataDirect();
if (!isRollback)
notifier.notifyNodeModified(fqn, true, NodeModifiedEvent.ModificationType.PUT_DATA, rawData, ctx);
@@ -2319,6 +2319,7 @@
Map<K, V> newData = Collections.singletonMap(key, value);
if (!isRollback)
notifier.notifyNodeModified(fqn, false, NodeModifiedEvent.ModificationType.PUT_DATA, newData, ctx);
+
return old_value;
}
@@ -4061,9 +4062,9 @@
}
}
- private NodeSPI<K, V> findNodeCheck(GlobalTransaction tx, Fqn fqn)
+ private NodeSPI<K, V> findNodeCheck(GlobalTransaction tx, Fqn fqn, boolean includeInvalid)
{
- NodeSPI<K, V> n = findNode(fqn);
+ NodeSPI<K, V> n = findNode(fqn, null, includeInvalid);
if (n == null)
{
String errStr = "node " + fqn + " not found (gtx=" + tx + ", caller=" + Thread.currentThread() + ")";
@@ -4090,9 +4091,6 @@
return false;
}
- // mark the node to be removed (and all children) as invalid so anyone holding a direct reference to it will
- // be aware that it is no longer valid.
- n.setValid(false, true);
if (log.isTraceEnabled()) log.trace("Performing a real remove for node " + f + ", marked for removal.");
if (skipMarkerCheck || n.isDeleted())
@@ -4103,10 +4101,18 @@
n.markAsDeleted(true);
// but now remove all children, since the call has been to remove("/")
n.removeChildrenDirect();
+
+ // mark the node to be removed (and all children) as invalid so anyone holding a direct reference to it will
+ // be aware that it is no longer valid.
+ n.setValid(false, true);
+ n.setValid(true, false);
return true;
}
else
{
+ // mark the node to be removed (and all children) as invalid so anyone holding a direct reference to it will
+ // be aware that it is no longer valid.
+ n.setValid(false, true);
return n.getParent().removeChildDirect(n.getFqn().getLastElement());
}
}
Modified: core/trunk/src/test/java/org/jboss/cache/transaction/TransactionTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/transaction/TransactionTest.java 2007-10-23 11:16:08 UTC (rev 4671)
+++ core/trunk/src/test/java/org/jboss/cache/transaction/TransactionTest.java 2007-10-23 11:54:46 UTC (rev 4672)
@@ -8,26 +8,6 @@
package org.jboss.cache.transaction;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertNull;
-import static org.testng.AssertJUnit.assertTrue;
-import static org.testng.AssertJUnit.fail;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-import javax.transaction.UserTransaction;
-
import org.jboss.cache.CacheException;
import org.jboss.cache.CacheFactory;
import org.jboss.cache.CacheImpl;
@@ -37,10 +17,23 @@
import org.jboss.cache.NodeSPI;
import org.jboss.cache.lock.IsolationLevel;
import org.jboss.cache.lock.NodeLock;
+import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.RollbackException;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
/**
* Tests transactional access to a local CacheImpl.
* Note: we use DummpyTranasctionManager to replace jta
@@ -990,6 +983,9 @@
assertTrue(cache.exists(A_B));
assertTrue(cache.exists(A));
+ assert cache.peek(A, true, true).isValid();
+ assert cache.peek(A_B, true, true).isValid();
+
assertEquals("v2", cache.get(A_B, "k"));
}
16 years, 6 months
JBoss Cache SVN: r4671 - core/trunk/src/test/java/org/jboss/cache/optimistic.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-10-23 07:16:08 -0400 (Tue, 23 Oct 2007)
New Revision: 4671
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/FullStackInterceptorTest.java
Log:
Disabled test
Modified: core/trunk/src/test/java/org/jboss/cache/optimistic/FullStackInterceptorTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/optimistic/FullStackInterceptorTest.java 2007-10-23 11:14:44 UTC (rev 4670)
+++ core/trunk/src/test/java/org/jboss/cache/optimistic/FullStackInterceptorTest.java 2007-10-23 11:16:08 UTC (rev 4671)
@@ -1,19 +1,7 @@
package org.jboss.cache.optimistic;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertNull;
-import static org.testng.AssertJUnit.assertTrue;
-import static org.testng.AssertJUnit.fail;
-import java.util.Set;
-
-import javax.transaction.RollbackException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
import junit.framework.Assert;
import junit.framework.AssertionFailedError;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.CacheImpl;
@@ -24,6 +12,13 @@
import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.OptimisticTransactionEntry;
import org.jboss.cache.transaction.TransactionTable;
+import static org.testng.AssertJUnit.*;
+import org.testng.annotations.Test;
+
+import javax.transaction.RollbackException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import java.util.Set;
/**
* @author xenephon
*/
@@ -792,6 +787,7 @@
*
* @throws Exception
*/
+ @Test(enabled = false) // known failure - JBCACHE-1201
public void testAsynchronousCommit() throws Exception
{
CacheImpl<Object, Object> cache1 = createSyncReplicatedCacheAsyncCommit();
16 years, 6 months
JBoss Cache SVN: r4670 - core/trunk/src/test/java/org/jboss/cache/mgmt.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-10-23 07:14:44 -0400 (Tue, 23 Oct 2007)
New Revision: 4670
Modified:
core/trunk/src/test/java/org/jboss/cache/mgmt/InvalidationTest.java
Log:
Fixed broken test
Modified: core/trunk/src/test/java/org/jboss/cache/mgmt/InvalidationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/mgmt/InvalidationTest.java 2007-10-23 11:06:11 UTC (rev 4669)
+++ core/trunk/src/test/java/org/jboss/cache/mgmt/InvalidationTest.java 2007-10-23 11:14:44 UTC (rev 4670)
@@ -1,12 +1,5 @@
package org.jboss.cache.mgmt;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertNull;
-import static org.testng.AssertJUnit.assertTrue;
-
-import java.util.HashMap;
-
import org.jboss.cache.CacheImpl;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
@@ -15,9 +8,12 @@
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
import org.jboss.cache.interceptors.InvalidationInterceptor;
import org.jboss.cache.misc.TestingUtil;
+import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+
+import java.util.HashMap;
/**
* Simple functional tests for InvalidationInterceptor statistics
*
@@ -104,7 +100,7 @@
// verify basic statistics for entries loaded into cache
assertEquals("Cache1 Invalidations count error: ", new Long(6), new Long(mgmt1.getInvalidations()));
- assertEquals("Cache2 Invalidations count error: ", new Long(10), new Long(mgmt2.getInvalidations()));
+ assertEquals("Cache2 Invalidations count error: ", new Long(9), new Long(mgmt2.getInvalidations()));
// reset statistics
mgmt1.resetStatistics();
@@ -135,7 +131,8 @@
private void loadCache2(CacheImpl<Object, Object> cache) throws Exception
{
- cache.put("Europe", new HashMap<Object, Object>());
+ // the following line will invalidate /Europe (and its' children) across the cluster!!
+// cache.put("Europe", new HashMap<Object, Object>());
cache.put("Europe/Austria", new HashMap<Object, Object>());
cache.put("Europe/Austria", CAPITAL, "Vienna");
cache.put("Europe/Austria", CURRENCY, "Euro");
16 years, 6 months
JBoss Cache SVN: r4669 - in core/trunk/src/main: release and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2007-10-23 07:06:11 -0400 (Tue, 23 Oct 2007)
New Revision: 4669
Modified:
core/trunk/src/main/docbook/tutorial/en/master.xml
core/trunk/src/main/release/build.xml
Log:
fixing
Modified: core/trunk/src/main/docbook/tutorial/en/master.xml
===================================================================
--- core/trunk/src/main/docbook/tutorial/en/master.xml 2007-10-23 09:06:30 UTC (rev 4668)
+++ core/trunk/src/main/docbook/tutorial/en/master.xml 2007-10-23 11:06:11 UTC (rev 4669)
@@ -95,12 +95,7 @@
<para>The only script needed for this tutorial is the
<literal>JBossCache/build.xml</literal>
- ant script and the accompanying
- driver scripts (
- <literal>build.sh</literal>
- for Unix and
- <literal>build.bat</literal>
- for Windows).
+ ant script. You also need to have <ulink url="http://ant.apache.org/">ant</ulink> installed for running the demo.
</para>
</section>
@@ -108,13 +103,11 @@
<title>Running The Demo GUI</title>
<para>
- The demo is run by calling the ant script (via the driver) with the
- <literal>run.demo</literal>
- target. E.g.,
+ The demo is run by calling the ant script with the <literal>run.demo</literal> target. E.g.,
</para>
<para>
- <literal>./build.sh run.demo</literal>
+ <literal>ant run.demo</literal>
</para>
<para>
This will cause a GUI window to appear, giving you a tree view of the cache in the top pane and a BeanShell
@@ -154,8 +147,7 @@
<section>
<title>Tutorials</title>
Note that it is recommended that you shut down and restart the demo GUI for each of the following tutorials, to
- ensure
- clean caches every time.
+ ensure clean caches every time.
<section>
<title>Caches and Nodes</title>
<para>
@@ -285,6 +277,15 @@
only starting transactions before creating/removing nodes or adding/removing data. This will depict how
replication only occurs on transaction boundaries. Try rolling back a few transactions as well, to see how
nothing gets replicated in these cases.
+ Below is the sample code for managing transactions:
+ <programlisting><![CDATA[
+
+ tm = cache.getTransactionManager();
+ tm.begin();
+ //do the operations here
+ tm.commit();//tm.rollback();
+
+ ]]></programlisting>
</para>
</section>
Modified: core/trunk/src/main/release/build.xml
===================================================================
--- core/trunk/src/main/release/build.xml 2007-10-23 09:06:30 UTC (rev 4668)
+++ core/trunk/src/main/release/build.xml 2007-10-23 11:06:11 UTC (rev 4669)
@@ -141,6 +141,7 @@
<classpath refid="test.classpath"/>
<jvmarg value="${jvm.ipv4}"/>
<jvmarg value="${jvm.localhost}"/>
+ <arg value="-console"/>
</java>
</target>
16 years, 6 months
JBoss Cache SVN: r4668 - in core/trunk/src/main/java/org/jboss/cache: eviction and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-10-23 05:06:30 -0400 (Tue, 23 Oct 2007)
New Revision: 4668
Modified:
core/trunk/src/main/java/org/jboss/cache/RegionImpl.java
core/trunk/src/main/java/org/jboss/cache/eviction/BaseEvictionAlgorithm.java
Log:
Null check for unit tests that don't completely initialise region managers when testing eviction algorithms, etc.
Modified: core/trunk/src/main/java/org/jboss/cache/RegionImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RegionImpl.java 2007-10-23 08:53:16 UTC (rev 4667)
+++ core/trunk/src/main/java/org/jboss/cache/RegionImpl.java 2007-10-23 09:06:30 UTC (rev 4668)
@@ -61,7 +61,10 @@
public Configuration getCacheConfiguration()
{
- return regionManager.getCache().getConfiguration();
+ if (regionManager!= null && regionManager.getCache() != null)
+ return regionManager.getCache().getConfiguration();
+ else
+ return null;
}
public void registerContextClassLoader(ClassLoader classLoader)
Modified: core/trunk/src/main/java/org/jboss/cache/eviction/BaseEvictionAlgorithm.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/eviction/BaseEvictionAlgorithm.java 2007-10-23 08:53:16 UTC (rev 4667)
+++ core/trunk/src/main/java/org/jboss/cache/eviction/BaseEvictionAlgorithm.java 2007-10-23 09:06:30 UTC (rev 4668)
@@ -78,8 +78,9 @@
evictionQueue = setupEvictionQueue(region);
log.debug("initialized: " + this);
// hacky temp solution till we have an ioc fwk to inject configuration elements as needed
- Configuration.CacheMode cm = region.getCacheConfiguration().getCacheMode();
- allowTombstones = region.getCacheConfiguration().isNodeLockingOptimistic() &&
+ Configuration c = region.getCacheConfiguration();
+ Configuration.CacheMode cm = c != null ? c.getCacheMode() : Configuration.CacheMode.LOCAL;
+ allowTombstones = c != null && c.isNodeLockingOptimistic() &&
(cm == Configuration.CacheMode.INVALIDATION_ASYNC || cm == Configuration.CacheMode.INVALIDATION_SYNC);
}
16 years, 6 months
JBoss Cache SVN: r4667 - in core/trunk/src: main/java/org/jboss/cache/interceptors and 2 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-10-23 04:53:16 -0400 (Tue, 23 Oct 2007)
New Revision: 4667
Modified:
core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java
core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveOptimisticTest.java
core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java
core/trunk/src/test/java/org/jboss/cache/options/ForceCacheModeTest.java
Log:
Fixed missing notifications on invalidation, added a null check and patched some tests
Modified: core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2007-10-23 01:40:26 UTC (rev 4666)
+++ core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2007-10-23 08:53:16 UTC (rev 4667)
@@ -2734,25 +2734,8 @@
{
Node<K, V> node = get(fqn); // force interceptor chain, load if necessary from cache loader.
- if (node != null)
+ if (node == null)
{
- // mark the node to be removed (and all children) as invalid so anyone holding a direct reference to it will
- // be aware that it is no longer valid.
- ((NodeSPI) node).setValid(false, true);
-
- if (configuration.isNodeLockingOptimistic())
- _removeData(null, fqn, false, false, true, versionToInvalidate);
- else
- _evict(fqn);
-
- if (versionToInvalidate != null)
- {
- NodeSPI n = peek(fqn, false, true);
- n.setVersion(versionToInvalidate);
- }
- }
- else
- {
// if pessimistic locking, just return.
if (!configuration.isNodeLockingOptimistic()) return;
@@ -2784,12 +2767,23 @@
}
nodeSPI = (NodeSPI) root.getChild(fqn);
}
- log.trace("Retrieved node. Setting version to " + versionToInvalidate + " and marking as invalid");
- nodeSPI.setVersion(versionToInvalidate);
- // mark the node to be removed (and all children) as invalid so anyone holding a direct reference to it will
- // be aware that it is no longer valid.
- nodeSPI.setValid(false, true);
+ node = nodeSPI;
}
+
+ if (configuration.isNodeLockingOptimistic())
+ _removeData(null, fqn, false, false, true, versionToInvalidate);
+ else
+ _evict(fqn);
+
+ // mark the node to be removed (and all children) as invalid so anyone holding a direct reference to it will
+ // be aware that it is no longer valid.
+ ((NodeSPI) node).setValid(false, true);
+
+ if (versionToInvalidate != null)
+ {
+ NodeSPI n = peek(fqn, false, true);
+ n.setVersion(versionToInvalidate);
+ }
}
/**
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java 2007-10-23 01:40:26 UTC (rev 4666)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java 2007-10-23 08:53:16 UTC (rev 4667)
@@ -229,7 +229,8 @@
for (Fqn child : deltas.get(1))
{
// mark it as invalid so any direct references are marked as such
- underlyingNode.getChildDirect(child.getLastElement()).setValid(false, true);
+ NodeSPI childNode = underlyingNode.getChildDirect(child.getLastElement());
+ if (childNode != null) childNode.setValid(false, true);
if (!useTombstones)
{
Modified: core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveOptimisticTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveOptimisticTest.java 2007-10-23 01:40:26 UTC (rev 4666)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveOptimisticTest.java 2007-10-23 08:53:16 UTC (rev 4667)
@@ -6,6 +6,9 @@
*/
package org.jboss.cache.api;
+import org.testng.annotations.Test;
+
+@Test(groups = {"functional", "jgroups"})
public class NodeReplicatedMoveOptimisticTest extends NodeReplicatedMoveTest
{
public NodeReplicatedMoveOptimisticTest()
Modified: core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java 2007-10-23 01:40:26 UTC (rev 4666)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java 2007-10-23 08:53:16 UTC (rev 4667)
@@ -6,20 +6,23 @@
*/
package org.jboss.cache.api;
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheImpl;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
+import org.jboss.cache.NodeSPI;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
-import static org.testng.AssertJUnit.*;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import javax.transaction.TransactionManager;
-import java.util.Collections;
@Test(groups = {"functional", "jgroups"})
public class NodeReplicatedMoveTest
@@ -107,8 +110,8 @@
assertEquals(vA, cache1.getRoot().getChild(A).get(k));
assertEquals(vB, cache1.getRoot().getChild(A).getChild(B).get(k));
- assert cache2.getRoot().getChild(A) != null : "Should not be null";
- assert cache2.getRoot().getChild(A).getChild(B) != null : "Should not be null";
+ assertInvalidated(cache2, A, "Should be invalidated");
+ assertInvalidated(cache2, new Fqn(A, B.getLastElement()), "Should be invalidated");
// now move...
cache1.move(nodeB.getFqn(), Fqn.ROOT);
@@ -116,16 +119,24 @@
assertEquals(vA, cache1.getRoot().getChild(A).get(k));
assertEquals(vB, cache1.getRoot().getChild(B).get(k));
- assert cache2.getRoot().getChild(A) != null : "Should not be null";
- assert cache2.getRoot().getChild(B) != null : "Should not be null";
+ assertInvalidated(cache2, A, "Should be invalidated");
+ assertInvalidated(cache2, B, "Should be invalidated");
// now make sure a node exists on cache 2
- cache2.getRoot().getChild(A).put("k2", "v2");
+ cache2.getRoot().addChild(A).put("k2", "v2");
// te invalidation will happen in afterCompletion, hence no exception!
- cache1.move(cache1.getRoot().getChild(B).getFqn(), cache1.getRoot().getChild(A).getFqn());// should throw an NPE
+ cache1.move(B, A);// should throw an NPE
}
+ private void assertInvalidated(Cache cache, Fqn fqn, String msg)
+ {
+ assert cache.getRoot().getChild(fqn) == null : msg;
+ NodeSPI n = ((CacheImpl) cache).peek(fqn, true, true);
+ assert n != null : msg;
+ assert !n.isValid() : msg;
+ }
+
public void testReplTxCommit() throws Exception
{
Fqn A_B = new Fqn<String>(A, B);
Modified: core/trunk/src/test/java/org/jboss/cache/options/ForceCacheModeTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/options/ForceCacheModeTest.java 2007-10-23 01:40:26 UTC (rev 4666)
+++ core/trunk/src/test/java/org/jboss/cache/options/ForceCacheModeTest.java 2007-10-23 08:53:16 UTC (rev 4667)
@@ -6,15 +6,6 @@
*/
package org.jboss.cache.options;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertNull;
-import static org.testng.AssertJUnit.assertTrue;
-
-import java.util.concurrent.CountDownLatch;
-
-import javax.transaction.TransactionManager;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.CacheException;
@@ -22,22 +13,23 @@
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.config.Configuration;
-import org.jboss.cache.config.Option;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.config.Option;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.notifications.annotation.CacheListener;
import org.jboss.cache.notifications.annotation.NodeEvicted;
import org.jboss.cache.notifications.annotation.NodeModified;
import org.jboss.cache.notifications.annotation.NodeRemoved;
import org.jboss.cache.notifications.event.NodeEvent;
-import org.jboss.cache.notifications.event.NodeEvictedEvent;
-import org.jboss.cache.notifications.event.NodeModifiedEvent;
-import org.jboss.cache.notifications.event.NodeRemovedEvent;
+import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+import javax.transaction.TransactionManager;
+import java.util.concurrent.CountDownLatch;
+
/**
* Tests functionality of {@link Option#setForceAsynchronous(boolean)} and
* {@link Option#setForceSynchronous(boolean)}.
@@ -464,25 +456,11 @@
boolean blocked;
@NodeModified
- public void nodeModified(NodeModifiedEvent event)
- {
- block(event);
- }
-
@NodeRemoved
- public void nodeRemoved(NodeRemovedEvent event)
- {
- block(event);
- }
-
@NodeEvicted
- public void nodeEvicted(NodeEvictedEvent event)
+ public void block(NodeEvent event)
{
- block(event);
- }
-
- private void block(NodeEvent event)
- {
+ log.warn("Received event notification " + event);
if (event.isPre() == false && FQNA.equals(event.getFqn()))
{
blocked = true;
16 years, 6 months