Author: bstansberry(a)jboss.com
Date: 2008-11-26 21:04:28 -0500 (Wed, 26 Nov 2008)
New Revision: 7205
Modified:
core/trunk/src/test/java/org/jboss/cache/integration/websession/util/WebSessionTestBase.java
Log:
Couple the replication listeners to the caches
Modified:
core/trunk/src/test/java/org/jboss/cache/integration/websession/util/WebSessionTestBase.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/integration/websession/util/WebSessionTestBase.java 2008-11-26
21:12:09 UTC (rev 7204)
+++
core/trunk/src/test/java/org/jboss/cache/integration/websession/util/WebSessionTestBase.java 2008-11-27
02:04:28 UTC (rev 7205)
@@ -22,7 +22,9 @@
package org.jboss.cache.integration.websession.util;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import org.jboss.cache.Cache;
@@ -31,6 +33,7 @@
import org.jboss.cache.integration.CacheManagerSupport;
import org.jboss.cache.integration.UnitTestCacheFactoryConfigurationRegistry;
import org.jboss.cache.integration.websession.util.WebAppMetadata.Granularity;
+import org.jboss.cache.util.internals.replicationlisteners.ReplicationListener;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
@@ -48,6 +51,7 @@
private AtomicInteger testCount = new AtomicInteger();
private List<CacheManager> cacheManagers;
private List<SessionManager> sessionManagers;
+ private Map<Cache<Object, Object>, ReplicationListener>
replicationListeners = new HashMap<Cache<Object, Object>,
ReplicationListener>();
@BeforeClass(alwaysRun = true)
public void beforeClass() throws Exception
@@ -59,7 +63,10 @@
{
Cache<Object, Object> cache = cm.getCache(getCacheConfigName(), true);
if (cache.getCacheStatus() != CacheStatus.STARTED)
+ {
cache.start();
+ }
+ replicationListeners.put(cache,
ReplicationListener.getReplicationListener(cache));
}
}
}
@@ -154,4 +161,9 @@
{
return Integer.valueOf(value);
}
+
+ protected ReplicationListener getReplicationListener(Cache<Object, Object>
cache)
+ {
+ return replicationListeners.get(cache);
+ }
}