[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/statetransfer ...
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/statetransfer
StateTransfer200Test.java
StateTransferTestBase.java
FailedStateTransferTest.java
Log:
Major changes to restructure cache and node object model
Revision Changes Path
1.12 +4 -6 JBossCache/tests/functional/org/jboss/cache/statetransfer/StateTransfer200Test.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: StateTransfer200Test.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/statetransfer/StateTransfer200Test.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- StateTransfer200Test.java 21 Dec 2006 21:41:36 -0000 1.11
+++ StateTransfer200Test.java 30 Dec 2006 17:49:59 -0000 1.12
@@ -8,10 +8,8 @@
package org.jboss.cache.statetransfer;
import org.jboss.cache.CacheSPI;
-import org.jboss.cache.DataNode;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
-import org.jboss.cache.TreeCacheProxyImpl;
import org.jboss.cache.buddyreplication.BuddyManager;
import org.jboss.cache.config.BuddyReplicationConfig;
import org.jboss.cache.factories.XmlConfigurationParser;
@@ -26,7 +24,7 @@
* Tests that state transfer works properly if the version is 2.0.0.GA.
*
* @author <a href="mailto://brian.stansberry@jboss.com">Brian Stansberry</a>
- * @version $Revision: 1.11 $
+ * @version $Revision: 1.12 $
*/
public class StateTransfer200Test extends VersionedTestBase
{
@@ -115,7 +113,7 @@
cache2.start();
fail("Should have caused an exception");
}
- catch(Exception e)
+ catch (Exception e)
{
assertNotNull(e);
}
1.27 +8 -7 JBossCache/tests/functional/org/jboss/cache/statetransfer/StateTransferTestBase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: StateTransferTestBase.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/statetransfer/StateTransferTestBase.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- StateTransferTestBase.java 22 Dec 2006 18:55:05 -0000 1.26
+++ StateTransferTestBase.java 30 Dec 2006 17:49:59 -0000 1.27
@@ -33,7 +33,6 @@
import org.jboss.cache.marshall.SelectedClassnameClassLoader;
import org.jboss.cache.misc.TestingUtil;
-
import java.io.File;
import java.util.HashMap;
import java.util.Map;
@@ -98,7 +97,7 @@
if (caches.get(cacheID) != null)
throw new IllegalStateException(cacheID + " already created");
-// TreeCache tree=new TreeCache();
+// CacheImpl tree=new CacheImpl();
//PropertyConfigurator config=new PropertyConfigurator();
String configFile = sync ? "META-INF/replSync-service.xml"
: "META-INF/replAsync-service.xml";
@@ -338,7 +337,9 @@
protected Exception exception;
protected Thread thread;
- CacheUser(){}
+ CacheUser()
+ {
+ }
CacheUser(Semaphore semaphore,
String name,
1.8 +24 -23 JBossCache/tests/functional/org/jboss/cache/statetransfer/FailedStateTransferTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: FailedStateTransferTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/statetransfer/FailedStateTransferTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- FailedStateTransferTest.java 21 Dec 2006 21:41:36 -0000 1.7
+++ FailedStateTransferTest.java 30 Dec 2006 17:49:59 -0000 1.8
@@ -22,14 +22,14 @@
package org.jboss.cache.statetransfer;
-import java.io.InputStream;
-
import org.jboss.cache.CacheException;
-import org.jboss.cache.TreeCache;
+import org.jboss.cache.CacheImpl;
import org.jboss.cache.Version;
import org.jboss.cache.factories.XmlConfigurationParser;
import org.jboss.cache.lock.TimeoutException;
+import java.io.InputStream;
+
/**
* A FailedStateTransferTest.
*
@@ -41,22 +41,22 @@
public void testFailedStateTransfer() throws Exception
{
- TreeCache tree = new SecretiveStateCache();
- tree.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/replAsync-service.xml"));
- tree.getConfiguration().setClusterName("VersionedTestBase");
- tree.getConfiguration().setReplVersionString(getReplicationVersion());
+ CacheImpl cache = new SecretiveStateCache();
+ cache.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/replAsync-service.xml"));
+ cache.getConfiguration().setClusterName("VersionedTestBase");
+ cache.getConfiguration().setReplVersionString(getReplicationVersion());
// Use a long timeout to facilitate setting debugger breakpoints
- tree.getConfiguration().setInitialStateRetrievalTimeout(60000);
+ cache.getConfiguration().setInitialStateRetrievalTimeout(60000);
// Put the cache in the map before starting, so if it fails in
// start it can still be destroyed later
- caches.put("secretive", tree.getCacheSPI());
+ caches.put("secretive", cache);
- tree.create();
- tree.start();
+ cache.create();
+ cache.start();
- TreeCache recipient = new SecretiveStateCache();
+ CacheImpl recipient = new SecretiveStateCache();
recipient.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/replAsync-service.xml"));
recipient.getConfiguration().setClusterName("VersionedTestBase");
recipient.getConfiguration().setReplVersionString(getReplicationVersion());
@@ -65,7 +65,7 @@
//Put the cache in the map before starting, so if it fails in
// start it can still be destroyed later
- caches.put("secretive2", recipient.getCacheSPI());
+ caches.put("secretive2", recipient);
try
{
@@ -84,13 +84,14 @@
return Version.version;
}
- private static class SecretiveStateCache extends TreeCache
+ private static class SecretiveStateCache extends CacheImpl
{
SecretiveStateCache() throws Exception
{
super();
ml = new Adaptor();
}
+
class Adaptor extends MessageListenerAdaptor
{
More information about the jboss-cvs-commits
mailing list