[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/buddyreplication ...
Manik Surtani
msurtani at jboss.com
Thu Nov 2 10:21:35 EST 2006
User: msurtani
Date: 06/11/02 10:21:35
Modified: tests/functional/org/jboss/cache/buddyreplication Tag:
Branch_JBossCache_1_4_0
BuddyReplicationTestsBase.java
Log:
added souts
Revision Changes Path
No revision
No revision
1.26.2.1 +240 -238 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.26
retrieving revision 1.26.2.1
diff -u -b -r1.26 -r1.26.2.1
--- BuddyReplicationTestsBase.java 1 Jun 2006 19:06:36 -0000 1.26
+++ BuddyReplicationTestsBase.java 2 Nov 2006 15:21:35 -0000 1.26.2.1
@@ -7,9 +7,9 @@
package org.jboss.cache.buddyreplication;
import junit.framework.TestCase;
-import org.jboss.cache.TreeCache;
-import org.jboss.cache.Fqn;
import org.jboss.cache.CacheException;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.TreeCache;
import org.jboss.cache.config.Option;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.xml.XmlHelper;
@@ -59,13 +59,13 @@
String xmlString = "<config><buddyReplicationEnabled>true</buddyReplicationEnabled>\n" +
"<buddyCommunicationTimeout>600000</buddyCommunicationTimeout>\n" +
" <buddyLocatorClass>org.jboss.cache.buddyreplication.NextMemberBuddyLocator</buddyLocatorClass>\n" +
- " <autoDataGravitation>"+useDataGravitation+"</autoDataGravitation>\n" +
- " <dataGravitationRemoveOnFind>"+removeOnFind+"</dataGravitationRemoveOnFind>\n" +
- " <buddyLocatorProperties>numBuddies = "+numBuddies+"</buddyLocatorProperties>\n";
+ " <autoDataGravitation>" + useDataGravitation + "</autoDataGravitation>\n" +
+ " <dataGravitationRemoveOnFind>" + removeOnFind + "</dataGravitationRemoveOnFind>\n" +
+ " <buddyLocatorProperties>numBuddies = " + numBuddies + "</buddyLocatorProperties>\n";
- if (buddyPoolName != null) xmlString += "<buddyPoolName>"+buddyPoolName+"</buddyPoolName>";
+ if (buddyPoolName != null) xmlString += "<buddyPoolName>" + buddyPoolName + "</buddyPoolName>";
xmlString += "</config>";
- c.setBuddyReplicationConfig( XmlHelper.stringToElement(xmlString) );
+ c.setBuddyReplicationConfig(XmlHelper.stringToElement(xmlString));
c.setFetchInMemoryState(true);
if (optimisticLocks)
@@ -106,7 +106,7 @@
tmpLoc += File.separator + "BuddyReplicationTestsBase-";
TreeCache[] caches = new TreeCache[numCaches];
- for (int i=0; i< numCaches; i++)
+ for (int i = 0; i < numCaches; i++)
{
caches[i] = createCacheWithCacheLoader((tmpLoc + i), useDataGravitation, removeOnFind, passivation, fetchPersistent, true);
}
@@ -122,15 +122,15 @@
TreeCache cache = createCache(1, null, useDataGravitation, removeOnFind, false);
String cloader = "<config>\n" +
- "<passivation>"+passivation+"</passivation>\n" +
+ "<passivation>" + passivation + "</passivation>\n" +
"<preload></preload>\n" +
"<cacheloader>\n" +
"<class>org.jboss.cache.loader.FileCacheLoader</class>\n" +
- "<properties>location=" +(location)+ "</properties>\n" +
+ "<properties>location=" + (location) + "</properties>\n" +
"<async>false</async>\n" +
"<shared>false</shared>\n" +
- "<fetchPersistentState>"+ fetchPersistent + "</fetchPersistentState>\n" +
+ "<fetchPersistentState>" + fetchPersistent + "</fetchPersistentState>\n" +
"</cacheloader>\n" +
"</config>";
@@ -154,11 +154,13 @@
protected TreeCache[] createCaches(int numBuddies, int numCaches, boolean useBuddyPool, boolean useDataGravitation, boolean optimisticLocks) throws Exception
{
TreeCache[] caches = new TreeCache[numCaches];
- for (int i=0; i<numCaches; i++)
+ System.out.println("Creating " + numCaches + " caches");
+ for (int i = 0; i < numCaches; i++)
{
caches[i] = createCache(optimisticLocks, numBuddies, useBuddyPool ? Character.toString((char) ('A' + i)) : null, useDataGravitation, true);
}
+ System.out.println("Blocking until all views recvd");
// allow some time for the caches to start up and discover each other
TestingUtil.blockUntilViewsReceived(caches, VIEW_BLOCK_TIMEOUT);
TestingUtil.sleepThread(getSleepTimeout());
@@ -174,7 +176,7 @@
if (caches != null)
{
- for (int i=0; i<caches.length;i++)
+ for (int i = 0; i < caches.length; i++)
{
if (caches[i] != null)
{
@@ -242,7 +244,7 @@
protected void dumpCacheContents(TreeCache[] caches)
{
System.out.println("**** START: Cache Contents ****");
- for (int i=0; i<caches.length; i++)
+ for (int i = 0; i < caches.length; i++)
{
if (caches[i] == null)
System.out.println(" ** Cache " + i + " is null!");
@@ -257,7 +259,7 @@
protected void assertNoLocks(TreeCache[] caches)
{
- for (int i=0;i<caches.length; i++)
+ for (int i = 0; i < caches.length; i++)
{
if (caches[i] != null) assertEquals(0, caches[i].getNumberOfLocksHeld());
}
More information about the jboss-cvs-commits
mailing list