[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/passivation ...
Manik Surtani
msurtani at jboss.com
Sat Dec 30 12:49:59 EST 2006
User: msurtani
Date: 06/12/30 12:49:59
Modified: tests/functional/org/jboss/cache/passivation
PassivationToLocalDelegatingCacheLoaderTest.java
LocalPassivationIntegrationTest.java
BasicPassivationTest.java
ReplicatedPassivationIntegrationTest.java
ConcurrentPassivationTest.java
PassivationTestsBase.java
Log:
Major changes to restructure cache and node object model
Revision Changes Path
1.8 +7 -6 JBossCache/tests/functional/org/jboss/cache/passivation/PassivationToLocalDelegatingCacheLoaderTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PassivationToLocalDelegatingCacheLoaderTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/passivation/PassivationToLocalDelegatingCacheLoaderTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- PassivationToLocalDelegatingCacheLoaderTest.java 16 Nov 2006 16:26:34 -0000 1.7
+++ PassivationToLocalDelegatingCacheLoaderTest.java 30 Dec 2006 17:49:59 -0000 1.8
@@ -2,7 +2,7 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.jboss.cache.TreeCache;
+import org.jboss.cache.CacheImpl;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.loader.DelegatingCacheLoader;
import org.jboss.cache.loader.LocalDelegatingCacheLoader;
@@ -11,17 +11,17 @@
* Runs a test against using delegated cache loader
*
* @author <a href="mailto:{hmesha at novell.com}">{Hany Mesha}</a>
- * @version $Id: PassivationToLocalDelegatingCacheLoaderTest.java,v 1.7 2006/11/16 16:26:34 vblagojevic Exp $
+ * @version $Id: PassivationToLocalDelegatingCacheLoaderTest.java,v 1.8 2006/12/30 17:49:59 msurtani Exp $
*/
public class PassivationToLocalDelegatingCacheLoaderTest extends PassivationTestsBase
{
- TreeCache delegating_cache;
+ CacheImpl delegating_cache;
DelegatingCacheLoader cache_loader;
protected void configureCache() throws Exception
{
- delegating_cache = new TreeCache();
+ delegating_cache = new CacheImpl();
delegating_cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
delegating_cache.create();
delegating_cache.start();
@@ -39,7 +39,8 @@
delegating_cache.destroy();
}
- public void testLoadAndStore() throws Exception{
+ public void testLoadAndStore() throws Exception
+ {
//TODO intentional overload since this test does not pass
//http://jira.jboss.com/jira/browse/JBCACHE-851
}
1.13 +5 -5 JBossCache/tests/functional/org/jboss/cache/passivation/LocalPassivationIntegrationTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LocalPassivationIntegrationTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/passivation/LocalPassivationIntegrationTest.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- LocalPassivationIntegrationTest.java 22 Dec 2006 03:16:49 -0000 1.12
+++ LocalPassivationIntegrationTest.java 30 Dec 2006 17:49:59 -0000 1.13
@@ -11,8 +11,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.AbstractCacheListener;
+import org.jboss.cache.CacheImpl;
import org.jboss.cache.Fqn;
-import org.jboss.cache.TreeCache;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.XmlConfigurationParser;
@@ -25,7 +25,7 @@
*/
public class LocalPassivationIntegrationTest extends TestCase
{
- TreeCache cache_;
+ CacheImpl cache_;
protected final static Log log = LogFactory.getLog(LocalPassivationIntegrationTest.class);
int wakeupIntervalMillis_ = 0;
PassivationListener listener_;
@@ -40,7 +40,7 @@
{
super.setUp();
TestingUtil.recursiveFileRemove("/tmp/JBossCacheFileCacheLoader"); // clean up any stale files left around by previous unit tests
- cache_ = new TreeCache();
+ cache_ = new CacheImpl();
initCaches(cache_);
cache_.getConfiguration().setUseRegionBasedMarshalling(true);
@@ -57,7 +57,7 @@
}
}
- void initCaches(TreeCache cache) throws Exception
+ void initCaches(CacheImpl cache) throws Exception
{
cache.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/local-passivation-service.xml")); // read in generic local xml
cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
@@ -93,7 +93,7 @@
cache_.put(str, str, str);
TestingUtil.sleepThread(20000);
- assertFalse("NodeImpl should not exist", cache_.exists(str, str));
+ assertFalse("UnversionedNode should not exist", cache_.exists(str, str));
String val = (String) cache_.get(str, str);
assertNotNull("DataNode should be activated ", val);
assertEquals("Eviction counter ", 1, listener_.getCounter());
1.13 +4 -4 JBossCache/tests/functional/org/jboss/cache/passivation/BasicPassivationTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BasicPassivationTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/passivation/BasicPassivationTest.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- BasicPassivationTest.java 20 Dec 2006 13:34:28 -0000 1.12
+++ BasicPassivationTest.java 30 Dec 2006 17:49:59 -0000 1.13
@@ -11,19 +11,19 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.jboss.cache.AbstractCacheListener;
+import org.jboss.cache.CacheImpl;
import org.jboss.cache.CacheListener;
import org.jboss.cache.Fqn;
-import org.jboss.cache.TreeCache;
import org.jboss.cache.factories.XmlConfigurationParser;
import org.jboss.cache.misc.TestingUtil;
/**
* @author Ben Wang
- * @version $Revision: 1.12 $
+ * @version $Revision: 1.13 $
*/
public class BasicPassivationTest extends TestCase
{
- TreeCache cache_;
+ CacheImpl cache_;
int wakeupIntervalMillis_ = 0;
final String ROOT_STR = "/test";
Throwable t1_ex, t2_ex;
@@ -54,7 +54,7 @@
void initCaches() throws Exception
{
- cache_ = new TreeCache();
+ cache_ = new CacheImpl();
cache_.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/local-passivation-service.xml")); // read in generic local xml
cache_.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
CacheListener listener = new TestCacheListener();
1.4 +11 -11 JBossCache/tests/functional/org/jboss/cache/passivation/ReplicatedPassivationIntegrationTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ReplicatedPassivationIntegrationTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/passivation/ReplicatedPassivationIntegrationTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- ReplicatedPassivationIntegrationTest.java 14 Nov 2006 14:17:11 -0000 1.3
+++ ReplicatedPassivationIntegrationTest.java 30 Dec 2006 17:49:59 -0000 1.4
@@ -23,13 +23,13 @@
package org.jboss.cache.passivation;
import junit.framework.TestCase;
-import org.jboss.cache.TreeCache;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jboss.cache.AbstractCacheListener;
+import org.jboss.cache.CacheImpl;
import org.jboss.cache.Fqn;
-import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.factories.XmlConfigurationParser;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.misc.TestingUtil;
import java.util.Map;
@@ -38,8 +38,8 @@
*/
public class ReplicatedPassivationIntegrationTest extends TestCase
{
- TreeCache cache_;
- TreeCache cache1_;
+ CacheImpl cache_;
+ CacheImpl cache1_;
protected final static Log log = LogFactory.getLog(ReplicatedPassivationIntegrationTest.class);
int wakeupIntervalMillis_ = 0;
ReplicatedPassivationIntegrationTest.PassivationListener listener_;
@@ -53,12 +53,12 @@
public void setUp() throws Exception
{
super.setUp();
- cache_ = new TreeCache();
+ cache_ = new CacheImpl();
initCaches(cache_);
cache_.getConfiguration().setUseRegionBasedMarshalling(true);
cache_.start();
- cache1_ = new TreeCache();
+ cache1_ = new CacheImpl();
initCaches(cache1_);
cache1_.getConfiguration().setUseRegionBasedMarshalling(true);
@@ -74,7 +74,7 @@
}
}
- void initCaches(TreeCache cache) throws Exception
+ void initCaches(CacheImpl cache) throws Exception
{
cache.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/replSync-passivation-service.xml")); // read in generic local xml
cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
@@ -101,7 +101,7 @@
cache_.put(rootStr1, str, str);
TestingUtil.sleepThread(11000);
- assertFalse("NodeImpl should not exist", cache1_.exists(str, str));
+ assertFalse("UnversionedNode should not exist", cache1_.exists(str, str));
String val;
val = (String) cache1_.get(str, str);
val = (String) cache1_.get(rootStr1, str);
@@ -144,7 +144,7 @@
{
if (pre)
{
- System.out.println("nodePassivate(): " +fqn);
+ System.out.println("nodePassivate(): " + fqn);
}
}
1.8 +4 -4 JBossCache/tests/functional/org/jboss/cache/passivation/ConcurrentPassivationTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ConcurrentPassivationTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/passivation/ConcurrentPassivationTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- ConcurrentPassivationTest.java 22 Dec 2006 03:29:29 -0000 1.7
+++ ConcurrentPassivationTest.java 30 Dec 2006 17:49:59 -0000 1.8
@@ -10,8 +10,8 @@
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.jboss.cache.CacheImpl;
import org.jboss.cache.Fqn;
-import org.jboss.cache.TreeCache;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.XmlConfigurationParser;
@@ -21,11 +21,11 @@
* Tests cache behavior in the presence of concurrent passivation.
*
* @author Brian Stansberry
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public class ConcurrentPassivationTest extends TestCase
{
- private TreeCache cache_;
+ private CacheImpl cache_;
private int wakeupIntervalMillis_ = 0;
public ConcurrentPassivationTest(String s)
@@ -46,7 +46,7 @@
void initCaches() throws Exception
{
TestingUtil.recursiveFileRemove("/tmp/JBossCacheFileCacheLoader");
- cache_ = new TreeCache();
+ cache_ = new CacheImpl();
cache_.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/local-passivation-service.xml")); // read in generic local xml
cache_.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
1.22 +6 -6 JBossCache/tests/functional/org/jboss/cache/passivation/PassivationTestsBase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PassivationTestsBase.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/passivation/PassivationTestsBase.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- PassivationTestsBase.java 15 Dec 2006 17:49:19 -0000 1.21
+++ PassivationTestsBase.java 30 Dec 2006 17:49:59 -0000 1.22
@@ -6,10 +6,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.CacheException;
-import org.jboss.cache.DataNode;
+import org.jboss.cache.CacheImpl;
import org.jboss.cache.Fqn;
import org.jboss.cache.Modification;
-import org.jboss.cache.TreeCache;
+import org.jboss.cache.Node;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.factories.XmlConfigurationParser;
import org.jboss.cache.loader.CacheLoader;
@@ -38,7 +38,7 @@
* Base tests for passivation using any of the cache loaders
*
* @author <a href="mailto:{hmesha at novell.com}">{Hany Mesha}</a>
- * @version $Id: PassivationTestsBase.java,v 1.21 2006/12/15 17:49:19 msurtani Exp $
+ * @version $Id: PassivationTestsBase.java,v 1.22 2006/12/30 17:49:59 msurtani Exp $
*/
abstract public class PassivationTestsBase extends TestCase
{
@@ -46,7 +46,7 @@
Log log = LogFactory.getLog(getClass());
//Cache Loader fields
- TreeCache cache;
+ CacheImpl cache;
CacheLoader loader = null;
Transaction tx = null;
static final Fqn FQN = new Fqn("key");
@@ -73,7 +73,7 @@
super.setUp();
log.debug("Testing " + getName());
log.debug("");
- cache = new TreeCache();
+ cache = new CacheImpl();
cache.getConfiguration().setCacheMode("local");
configureCache();
// cache.setCacheLoaderPreload("/1/2/3/4/5/d");
@@ -429,7 +429,7 @@
cache.put("/a/3", null);
System.out.println("cache is " + cache.printLockInfo());
- DataNode n = cache.get("/a");
+ Node n = cache.get("/a");
assertNotNull(n);
Set children = cache.getChildrenNames("/a");
More information about the jboss-cvs-commits
mailing list