[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/buddyreplication ...
Manik Surtani
msurtani at jboss.com
Mon Sep 11 13:02:43 EDT 2006
User: msurtani
Date: 06/09/11 13:02:43
Modified: tests/functional/org/jboss/cache/buddyreplication
BuddyReplicationConfigTest.java
Log:
- fixed Data Gravitation interceptor breakages
- correctly implemented cache.gravidateData()
- set DummyTM in buddy-replication-service.xml
Revision Changes Path
1.8 +8 -9 JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationConfigTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BuddyReplicationConfigTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyReplicationConfigTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- BuddyReplicationConfigTest.java 6 Sep 2006 15:30:57 -0000 1.7
+++ BuddyReplicationConfigTest.java 11 Sep 2006 17:02:43 -0000 1.8
@@ -8,13 +8,13 @@
import junit.framework.TestCase;
import org.jboss.cache.TreeCache;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.XmlConfigurationParser;
import org.jboss.cache.interceptors.DataGravitatorInterceptor;
+import org.jboss.cache.interceptors.Interceptor;
import org.jboss.cache.xml.XmlHelper;
import org.w3c.dom.Element;
-import java.util.Iterator;
-
/**
* Tests basic configuration options by passing stuff into the TreeCache.
*
@@ -43,7 +43,9 @@
String xmlConfig = "<config><buddyReplicationEnabled>true</buddyReplicationEnabled></config>";
Element config = XmlHelper.stringToElement(xmlConfig);
TreeCache cache = new TreeCache();
+ cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
cache.getConfiguration().setBuddyReplicationConfig(config);
+ cache.create();
assertNotNull(cache.getBuddyManager());
BuddyManager mgr = cache.getBuddyManager();
assertTrue(mgr.isEnabled());
@@ -57,9 +59,7 @@
{
TreeCache cache = new TreeCache();
cache.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/buddyreplication-service.xml"));
-
cache.create();
-
BuddyManager bm = cache.getBuddyManager();
assertNotNull(bm);
assertTrue(bm.isEnabled());
@@ -71,15 +71,14 @@
assertEquals(2000, bm.buddyCommunicationTimeout);
// test Data Gravitator
- Iterator i = cache.getInterceptors().iterator();
-
boolean hasDG = false;
- while (i.hasNext())
+ for (Interceptor interceptor : cache.getInterceptors())
{
- Object o = i.next();
- hasDG = hasDG || (o instanceof DataGravitatorInterceptor);
+ hasDG = hasDG || (interceptor instanceof DataGravitatorInterceptor);
}
+ System.out.println(cache.getInterceptorChain());
+
assertTrue("Should have a data gravitator!!", hasDG);
}
}
More information about the jboss-cvs-commits
mailing list