[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/buddyreplication ...
Manik Surtani
msurtani at jboss.com
Thu Jan 11 08:49:22 EST 2007
User: msurtani
Date: 07/01/11 08:49:22
Modified: tests/functional/org/jboss/cache/buddyreplication
BuddyBackupActivationInactivationTest.java
BuddyReplicationConfigTest.java
BuddyReplicationTestsBase.java
Log:
Changed CacheImpl ctor to be protected, and changed cache factories accordingly
Revision Changes Path
1.15 +17 -14 JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyBackupActivationInactivationTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BuddyBackupActivationInactivationTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/buddyreplication/BuddyBackupActivationInactivationTest.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- BuddyBackupActivationInactivationTest.java 10 Jan 2007 15:39:52 -0000 1.14
+++ BuddyBackupActivationInactivationTest.java 11 Jan 2007 13:49:22 -0000 1.15
@@ -7,6 +7,7 @@
package org.jboss.cache.buddyreplication;
import org.jboss.cache.CacheImpl;
+import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.config.BuddyReplicationConfig;
import org.jboss.cache.config.Configuration;
@@ -105,7 +106,7 @@
// when the region is activated. After discussions with Brian, the queueing
// was removed, presuming FLUSH will fix this. Need to test with FLUSH.
// - Manik Surtani (16 Oct 2006)
-/*
+ /*
CacheImpl cache1 = createCache("cache1", true, true, true);
cache1.activateRegion("/a");
@@ -120,7 +121,7 @@
cache1.inactivateRegion("/a");
assertNull("Inactivation cleared region", cache1.get(fqn, "name"));
-*/
+ */
}
@@ -131,11 +132,13 @@
throws Exception
{
if (caches.get(cacheID) != null)
+ {
throw new IllegalStateException(cacheID + " already created");
+ }
- CacheImpl cache = new CacheImpl();
+ CacheImpl cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
- CacheMode mode = sync ? CacheMode.REPL_SYNC:CacheMode.REPL_ASYNC;
+ CacheMode mode = sync ? CacheMode.REPL_SYNC : CacheMode.REPL_ASYNC;
Configuration c = UnitTestCacheFactory.createConfiguration(mode);
cache.setConfiguration(c);
1.13 +5 -4 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.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- BuddyReplicationConfigTest.java 30 Dec 2006 17:50:00 -0000 1.12
+++ BuddyReplicationConfigTest.java 11 Jan 2007 13:49:22 -0000 1.13
@@ -8,6 +8,7 @@
import junit.framework.TestCase;
import org.jboss.cache.CacheImpl;
+import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.config.BuddyReplicationConfig;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.XmlConfigurationParser;
@@ -25,7 +26,7 @@
{
public void testNullConfig() throws Exception
{
- CacheImpl cache = new CacheImpl();
+ CacheImpl cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
cache.getConfiguration().setBuddyReplicationConfig(null);
assertNull(cache.getBuddyManager());
}
@@ -35,7 +36,7 @@
String xmlConfig = "<config><buddyReplicationEnabled>false</buddyReplicationEnabled></config>";
Element element = XmlHelper.stringToElement(xmlConfig);
BuddyReplicationConfig config = XmlConfigurationParser.parseBuddyReplicationConfig(element);
- CacheImpl cache = new CacheImpl();
+ CacheImpl cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
cache.getConfiguration().setBuddyReplicationConfig(config);
assertNull(cache.getBuddyManager());
}
@@ -45,7 +46,7 @@
String xmlConfig = "<config><buddyReplicationEnabled>true</buddyReplicationEnabled></config>";
Element element = XmlHelper.stringToElement(xmlConfig);
BuddyReplicationConfig config = XmlConfigurationParser.parseBuddyReplicationConfig(element);
- CacheImpl cache = new CacheImpl();
+ CacheImpl cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
cache.getConfiguration().setBuddyReplicationConfig(config);
cache.create();
@@ -61,7 +62,7 @@
public void testXmlConfig() throws Exception
{
- CacheImpl cache = new CacheImpl();
+ CacheImpl cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
cache.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/buddyreplication-service.xml"));
cache.create();
BuddyManager bm = cache.getBuddyManager();
1.40 +2 -1 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.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- BuddyReplicationTestsBase.java 11 Jan 2007 12:07:29 -0000 1.39
+++ BuddyReplicationTestsBase.java 11 Jan 2007 13:49:22 -0000 1.40
@@ -9,6 +9,7 @@
import junit.framework.TestCase;
import org.jboss.cache.Cache;
import org.jboss.cache.CacheImpl;
+import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.config.BuddyReplicationConfig;
import org.jboss.cache.config.CacheLoaderConfig;
@@ -62,7 +63,7 @@
protected CacheImpl createCache(boolean optimisticLocks, int numBuddies, String buddyPoolName, boolean useDataGravitation, boolean removeOnFind, boolean start) throws Exception
{
- CacheImpl c = new CacheImpl();
+ CacheImpl c = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
Configuration conf = UnitTestCacheFactory.createConfiguration(CacheMode.REPL_SYNC);
c.setConfiguration(conf);
c.getConfiguration().setClusterName("BuddyReplicationTest");
More information about the jboss-cvs-commits
mailing list