[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/buddyreplication ...
Brian Stansberry
brian.stansberry at jboss.com
Tue Jan 2 23:03:47 EST 2007
User: bstansberry
Date: 07/01/02 23:03:47
Modified: tests/functional/org/jboss/cache/buddyreplication
BuddyReplicationTestsBase.java
Log:
[JBCACHE-920] Port multiplexer integration tests to HEAD
Revision Changes Path
1.36 +39 -2 JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BuddyReplicationTestsBase.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- BuddyReplicationTestsBase.java 2 Jan 2007 17:15:30 -0000 1.35
+++ BuddyReplicationTestsBase.java 3 Jan 2007 04:03:47 -0000 1.36
@@ -7,6 +7,8 @@
package org.jboss.cache.buddyreplication;
import junit.framework.TestCase;
+
+import org.jboss.cache.Cache;
import org.jboss.cache.CacheImpl;
import org.jboss.cache.Fqn;
import org.jboss.cache.config.BuddyReplicationConfig;
@@ -14,6 +16,7 @@
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.XmlConfigurationParser;
import org.jboss.cache.loader.CacheLoader;
+import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.xml.XmlHelper;
import org.jgroups.Address;
@@ -83,11 +86,41 @@
c.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
c.getConfiguration().setSyncCommitPhase(true); // helps track down breakages
+ // Call the hook that allows mux integration if that's what the test wants
+ configureMultiplexer(c);
+
if (start)
+ {
c.start();
+ validateMultiplexer(c);
+ }
return c;
}
+ /**
+ * Provides a hook for multiplexer integration. This default implementation
+ * is a no-op; subclasses that test mux integration would override
+ * to integrate the given cache with a multiplexer.
+ * <p/>
+ * param cache a cache that has been configured but not yet created.
+ */
+ protected void configureMultiplexer(Cache cache) throws Exception
+ {
+ // default does nothing
+ }
+
+ /**
+ * Provides a hook to check that the cache's channel came from the
+ * multiplexer, or not, as expected. This default impl asserts that
+ * the channel did not come from the multiplexer.
+ *
+ * @param cache a cache that has already been started
+ */
+ protected void validateMultiplexer(Cache cache)
+ {
+ assertFalse("Cache is not using multiplexer", cache.getConfiguration().isUsingMultiplexer());
+ }
+
protected CacheImpl[] createCaches(int numCaches, boolean useBuddyPool) throws Exception
{
return createCaches(1, numCaches, useBuddyPool, false);
@@ -205,8 +238,12 @@
{
}
}
+ CacheLoaderManager clm = c.getCacheLoaderManager();
+ if (clm != null)
+ {
CacheLoader cl = c.getCacheLoaderManager().getCacheLoader();
if (cl != null) cl.remove(Fqn.ROOT);
+ }
c.stop();
}
More information about the jboss-cvs-commits
mailing list