[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/replicated ...
Manik Surtani
msurtani at jboss.com
Thu Jul 20 05:03:55 EDT 2006
User: msurtani
Date: 06/07/20 05:03:55
Modified: tests/functional/org/jboss/cache/replicated
AsyncReplTest.java SyncCacheListenerTest.java
Log:
Fixed some broken UTs to use the new xml parsers, cache factories, etc.
Revision Changes Path
1.8 +11 -10 JBossCache/tests/functional/org/jboss/cache/replicated/AsyncReplTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AsyncReplTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/replicated/AsyncReplTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- AsyncReplTest.java 24 May 2006 10:18:55 -0000 1.7
+++ AsyncReplTest.java 20 Jul 2006 09:03:55 -0000 1.8
@@ -16,6 +16,7 @@
import org.jboss.cache.PropertyConfigurator;
import org.jboss.cache.TreeCache;
import org.jboss.cache.Fqn;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.misc.TestingUtil;
import javax.transaction.TransactionManager;
@@ -24,7 +25,7 @@
* Unit test for replicated async TreeCache. Use locking and multiple threads to test
* concurrent access to the tree.
*
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public class AsyncReplTest extends TestCase {
TreeCache cache1, cache2;
@@ -48,7 +49,7 @@
TreeCache tree=new TreeCache();
PropertyConfigurator config=new PropertyConfigurator();
config.configure(tree, "META-INF/replAsync-service.xml"); // read in generic replAsync xml
- tree.setClusterName(name);
+ tree.getConfiguration().setClusterName(name);
tree.createService();
tree.startService();
return tree;
@@ -198,10 +199,10 @@
public void testSyncRepl() throws Exception {
Fqn fqn = Fqn.fromString("/JSESSIONID/1010.10.5:3000/1234567890/1");
Integer age;
- cache1.setCacheMode(TreeCache.REPL_SYNC);
- cache1.setSyncCommitPhase(true);
- cache2.setCacheMode(TreeCache.REPL_SYNC);
- cache2.setSyncCommitPhase(true);
+ cache1.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
+ cache1.getConfiguration().setSyncCommitPhase(true);
+ cache2.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
+ cache2.getConfiguration().setSyncCommitPhase(true);
try {
@@ -219,10 +220,10 @@
}
public void testSyncReplSimple() throws Exception {
- cache1.setCacheMode(TreeCache.REPL_SYNC);
- cache1.setSyncCommitPhase(true);
- cache2.setCacheMode(TreeCache.REPL_SYNC);
- cache2.setSyncCommitPhase(true);
+ cache1.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
+ cache1.getConfiguration().setSyncCommitPhase(true);
+ cache2.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
+ cache2.getConfiguration().setSyncCommitPhase(true);
try {
cache1.put("/a", "x", "y");
1.8 +17 -16 JBossCache/tests/functional/org/jboss/cache/replicated/SyncCacheListenerTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SyncCacheListenerTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/replicated/SyncCacheListenerTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- SyncCacheListenerTest.java 18 Jul 2006 10:50:47 -0000 1.7
+++ SyncCacheListenerTest.java 20 Jul 2006 09:03:55 -0000 1.8
@@ -17,6 +17,7 @@
import org.jboss.cache.CacheException;
import org.jboss.cache.Fqn;
import org.jboss.cache.TreeCache;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.lock.IsolationLevel;
import org.jboss.cache.transaction.DummyTransactionManager;
@@ -31,11 +32,11 @@
/**
* Test out the TreeCacheListener
*
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public class SyncCacheListenerTest extends TestCase {
TreeCache cache1, cache2;
- int caching_mode=TreeCache.REPL_SYNC;
+ Configuration.CacheMode caching_mode= Configuration.CacheMode.REPL_SYNC;
final String group_name="TreeCacheTestGroup";
String props=
"UDP(ip_mcast=true;ip_ttl=64;loopback=false;mcast_addr=228.1.2.3;" +
@@ -91,23 +92,23 @@
return tx;
}
- void initCaches(int caching_mode) throws Exception {
+ void initCaches(Configuration.CacheMode caching_mode) throws Exception {
this.caching_mode=caching_mode;
cache1=new TreeCache();
cache2=new TreeCache();
- cache1.setCacheMode(caching_mode);
- cache2.setCacheMode(caching_mode);
- cache1.setIsolationLevel(IsolationLevel.SERIALIZABLE);
- cache2.setIsolationLevel(IsolationLevel.SERIALIZABLE);
+ cache1.getConfiguration().setCacheMode(caching_mode);
+ cache2.getConfiguration().setCacheMode(caching_mode);
+ cache1.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
+ cache2.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
- cache1.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
- cache2.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
+ cache1.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
+ cache2.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
/*
cache1.setTransactionManagerLookupClass("org.jboss.cache.JBossTransactionManagerLookup");
cache2.setTransactionManagerLookupClass("org.jboss.cache.JBossTransactionManagerLookup");
*/
- cache1.setLockAcquisitionTimeout(5000);
- cache2.setLockAcquisitionTimeout(5000);
+ cache1.getConfiguration().setLockAcquisitionTimeout(5000);
+ cache2.getConfiguration().setLockAcquisitionTimeout(5000);
cache1.start();
cache2.start();
}
@@ -126,7 +127,7 @@
Transaction tx;
try {
- initCaches(TreeCache.REPL_SYNC);
+ initCaches(Configuration.CacheMode.REPL_SYNC);
tx=beginTransaction();
Listener lis = new Listener();
@@ -148,7 +149,7 @@
public void testRemoteCacheListener() throws Exception {
Integer age;
try {
- initCaches(TreeCache.REPL_SYNC);
+ initCaches(Configuration.CacheMode.REPL_SYNC);
RemoteListener lis = new RemoteListener();
cache2.addTreeCacheListener(lis);
cache1.put("/a/b/c", "age", new Integer(38));
@@ -168,7 +169,7 @@
public void testSyncRepl() throws Exception {
Integer age;
try {
- initCaches(TreeCache.REPL_SYNC);
+ initCaches(Configuration.CacheMode.REPL_SYNC);
Listener lis = new Listener();
cache1.addTreeCacheListener(lis);
@@ -189,7 +190,7 @@
Transaction tx;
try {
- initCaches(TreeCache.REPL_SYNC);
+ initCaches(Configuration.CacheMode.REPL_SYNC);
tx=beginTransaction();
Listener lis = new Listener();
@@ -215,7 +216,7 @@
public void testSyncReplMap() throws Exception {
Integer age;
try {
- initCaches(TreeCache.REPL_SYNC);
+ initCaches(Configuration.CacheMode.REPL_SYNC);
Listener lis = new Listener();
cache1.addTreeCacheListener(lis);
More information about the jboss-cvs-commits
mailing list