[jboss-cvs] JBossCache/tests/stress/org/jboss/cache ...
Manik Surtani
msurtani at jboss.com
Thu Jul 20 05:03:56 EDT 2006
User: msurtani
Date: 06/07/20 05:03:56
Modified: tests/stress/org/jboss/cache EvictionLocalStressTest.java
LocalStressTest.java
Log:
Fixed some broken UTs to use the new xml parsers, cache factories, etc.
Revision Changes Path
1.4 +9 -8 JBossCache/tests/stress/org/jboss/cache/EvictionLocalStressTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: EvictionLocalStressTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/stress/org/jboss/cache/EvictionLocalStressTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- EvictionLocalStressTest.java 31 May 2006 14:08:39 -0000 1.3
+++ EvictionLocalStressTest.java 20 Jul 2006 09:03:56 -0000 1.4
@@ -16,6 +16,7 @@
import org.jboss.cache.lock.IsolationLevel;
import org.jboss.cache.lock.LockStrategyFactory;
import org.jboss.cache.transaction.DummyTransactionManager;
+import org.jboss.cache.config.Configuration;
import javax.naming.Context;
import javax.transaction.Transaction;
@@ -27,13 +28,13 @@
/**
* Local mode stress test for TreeCache.
*
- * @version $Id: EvictionLocalStressTest.java,v 1.3 2006/05/31 14:08:39 msurtani Exp $
+ * @version $Id: EvictionLocalStressTest.java,v 1.4 2006/07/20 09:03:56 msurtani Exp $
* @author <a href="mailto:bwang at jboss.org">Ben Wang</a> May 20 2003
*/
public class EvictionLocalStressTest extends TestCase
{
static TreeCache cache_;
- int cachingMode_ = TreeCache.LOCAL;
+ Configuration.CacheMode cachingMode_ = Configuration.CacheMode.LOCAL;
final static Properties p_;
String oldFactory_ = null;
final String FACTORY = "org.jboss.cache.transaction.DummyContextFactory";
@@ -65,7 +66,7 @@
oldFactory_ = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
System.setProperty(Context.INITIAL_CONTEXT_FACTORY, FACTORY);
DummyTransactionManager.getInstance();
- initCaches(TreeCache.LOCAL);
+ initCaches(Configuration.CacheMode.LOCAL);
nodeList_ = nodeGen(depth_, children_);
log("LocalStressTestCase: cacheMode=TRANSIENT, one cache");
thread_ex=null;
@@ -85,14 +86,14 @@
- void initCaches(int caching_mode) throws Exception
+ void initCaches(Configuration.CacheMode caching_mode) throws Exception
{
cachingMode_ = caching_mode;
cache_ = new TreeCache();
PropertyConfigurator config = new PropertyConfigurator();
config.configure(cache_, "META-INF/local-lru-eviction-service.xml"); // read in generic local xml
- cache_.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
- cache_.setLockAcquisitionTimeout(10000);
+ cache_.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
+ cache_.getConfiguration().setLockAcquisitionTimeout(10000);
cache_.createService();
cache_.startService();
}
@@ -107,14 +108,14 @@
{
log("set lock level to RWUpgrade ...");
LockStrategyFactory.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
- cache_.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ cache_.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
}
protected void setLevelSerial()
{
log("set lock level to SimpleLock ...");
LockStrategyFactory.setIsolationLevel(IsolationLevel.SERIALIZABLE);
- cache_.setIsolationLevel(IsolationLevel.SERIALIZABLE);
+ cache_.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
}
public void testAllTx_RWLock() throws Exception
1.4 +6 -5 JBossCache/tests/stress/org/jboss/cache/LocalStressTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LocalStressTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/stress/org/jboss/cache/LocalStressTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- LocalStressTest.java 31 May 2006 14:08:39 -0000 1.3
+++ LocalStressTest.java 20 Jul 2006 09:03:56 -0000 1.4
@@ -14,6 +14,7 @@
import org.jboss.cache.lock.IsolationLevel;
import org.jboss.cache.lock.LockStrategyFactory;
import org.jboss.cache.transaction.DummyTransactionManager;
+import org.jboss.cache.config.Configuration;
import javax.naming.Context;
import javax.naming.InitialContext;
@@ -33,13 +34,13 @@
/**
* Local mode stress test for TreeCache.
*
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
* @author <a href="mailto:bwang at jboss.org">Ben Wang</a> May 20 2003
*/
public class LocalStressTest extends TestCase
{
static TreeCache cache_;
- int cachingMode_ = TreeCache.LOCAL;
+ Configuration.CacheMode cachingMode_ = Configuration.CacheMode.LOCAL;
final static Properties p_;
// final static Log log_=LogFactory.getLog(LocalStressTestCase.class);
String oldFactory_ = null;
@@ -72,7 +73,7 @@
System.setProperty(Context.INITIAL_CONTEXT_FACTORY, FACTORY);
DummyTransactionManager.getInstance();
- initCaches(TreeCache.LOCAL);
+ initCaches(CacheMode.LOCAL);
nodeList_ = nodeGen(depth_, children_);
tm_ = new DummyTransactionManager();
@@ -93,13 +94,13 @@
}
- void initCaches(int caching_mode) throws Exception
+ void initCaches(Configuration.CacheMode caching_mode) throws Exception
{
cachingMode_ = caching_mode;
cache_ = new TreeCache();
PropertyConfigurator config = new PropertyConfigurator();
config.configure(cache_, "META-INF/local-lru-eviction-service.xml"); // read in generic local xml
- cache_.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
+ cache_.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
cache_.createService();
cache_.startService();
}
More information about the jboss-cvs-commits
mailing list