[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/marshall ...
Manik Surtani
msurtani at jboss.com
Sat Dec 30 12:49:57 EST 2006
User: msurtani
Date: 06/12/30 12:49:57
Modified: tests/functional/org/jboss/cache/marshall
RegionManagerTest.java AsyncReplTest.java
SyncReplTest.java ActiveInactiveTest.java
ReplicateToInactiveRegionTest.java LocalTest.java
RedeploymentEmulationTest.java
Log:
Major changes to restructure cache and node object model
Revision Changes Path
1.7 +2 -2 JBossCache/tests/functional/org/jboss/cache/marshall/RegionManagerTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RegionManagerTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/marshall/RegionManagerTest.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- RegionManagerTest.java 15 Nov 2006 23:48:32 -0000 1.6
+++ RegionManagerTest.java 30 Dec 2006 17:49:57 -0000 1.7
@@ -1,10 +1,10 @@
package org.jboss.cache.marshall;
import junit.framework.TestCase;
+import org.jboss.cache.CacheImpl;
import org.jboss.cache.Fqn;
import org.jboss.cache.Region;
import org.jboss.cache.RegionManager;
-import org.jboss.cache.TreeCache;
import java.util.ArrayList;
import java.util.Collections;
@@ -21,7 +21,7 @@
public void setUp() throws Exception
{
- r = new RegionManager(new TreeCache());
+ r = new RegionManager(new CacheImpl());
}
public void tearDown() throws Exception
1.13 +30 -28 JBossCache/tests/functional/org/jboss/cache/marshall/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/marshall/AsyncReplTest.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- AsyncReplTest.java 5 Dec 2006 23:07:25 -0000 1.12
+++ AsyncReplTest.java 30 Dec 2006 17:49:57 -0000 1.13
@@ -12,8 +12,8 @@
import junit.framework.Test;
import junit.framework.TestSuite;
import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.CacheImpl;
import org.jboss.cache.Fqn;
-import org.jboss.cache.TreeCache;
import org.jboss.cache.factories.XmlConfigurationParser;
import org.jboss.cache.marshall.data.Address;
import org.jboss.cache.marshall.data.Person;
@@ -29,11 +29,11 @@
* Test marshalling for async mode.
*
* @author Ben Wang
- * @version $Revision: 1.12 $
+ * @version $Revision: 1.13 $
*/
public class AsyncReplTest extends RegionBasedMarshallingTestBase
{
- TreeCache cache1, cache2;
+ CacheImpl cache1, cache2;
String props = null;
Person ben_;
Address addr_;
@@ -57,19 +57,19 @@
ben_.setAddress(addr_);
// Pause to give caches time to see each other
- TestingUtil.blockUntilViewsReceived(new TreeCache[]{cache1, cache2}, 60000);
+ TestingUtil.blockUntilViewsReceived(new CacheImpl[]{cache1, cache2}, 60000);
}
- private TreeCache createCache(String name) throws Exception
+ private CacheImpl createCache(String name) throws Exception
{
- TreeCache tree = new TreeCache();
- tree.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/replAsync-service.xml"));
- tree.getConfiguration().setClusterName(name);
+ CacheImpl cache = new CacheImpl();
+ cache.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/replAsync-service.xml"));
+ cache.getConfiguration().setClusterName(name);
// Use marshaller
- tree.getConfiguration().setUseRegionBasedMarshalling(true);
- tree.create();
- tree.start();
- return tree;
+ cache.getConfiguration().setUseRegionBasedMarshalling(true);
+ cache.create();
+ cache.start();
+ return cache;
}
public void tearDown() throws Exception
@@ -180,7 +180,8 @@
assertFalse("cache2 deserialized with scoped classloader", ben2 instanceof Person);
assertFalse("cache2 deserialized with cache2 classloader", scopedBen1.equals(ben2));
assertEquals("scopedBen deserialized properly", scopedBen2, ben2);
- } catch (Exception ex)
+ }
+ catch (Exception ex)
{
fail("Test fails with exception " + ex);
}
@@ -284,15 +285,16 @@
{
Object val = cache2.get(new Fqn(base, custom2), "key");
assertEquals("value", val);
- } catch (Exception ex)
+ }
+ catch (Exception ex)
{
- fail("Test fails with exception " +ex);
+ fail("Test fails with exception " + ex);
}
}
Transaction beginTransaction() throws SystemException, NotSupportedException
{
- DummyTransactionManager mgr=DummyTransactionManager.getInstance();
+ DummyTransactionManager mgr = DummyTransactionManager.getInstance();
mgr.begin();
return mgr.getTransaction();
}
1.14 +10 -10 JBossCache/tests/functional/org/jboss/cache/marshall/SyncReplTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SyncReplTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/marshall/SyncReplTest.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- SyncReplTest.java 18 Dec 2006 12:27:52 -0000 1.13
+++ SyncReplTest.java 30 Dec 2006 17:49:57 -0000 1.14
@@ -11,8 +11,8 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.jboss.cache.CacheImpl;
import org.jboss.cache.Fqn;
-import org.jboss.cache.TreeCache;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.XmlConfigurationParser;
import org.jboss.cache.marshall.data.Address;
@@ -30,11 +30,11 @@
* Test case for marshalling using Sync mode.
*
* @author Ben Wang
- * @version $Revision: 1.13 $
+ * @version $Revision: 1.14 $
*/
public class SyncReplTest extends RegionBasedMarshallingTestBase
{
- TreeCache cache1, cache2;
+ CacheImpl cache1, cache2;
String props = null;
Person ben_;
Address addr_;
@@ -57,23 +57,23 @@
ben_.setAddress(addr_);
// Pause to give caches time to see each other
- TestingUtil.blockUntilViewsReceived(new TreeCache[]{cache1, cache2}, 60000);
+ TestingUtil.blockUntilViewsReceived(new CacheImpl[]{cache1, cache2}, 60000);
}
- private TreeCache createCache(String name) throws Exception
+ private CacheImpl createCache(String name) throws Exception
{
- TreeCache tree = new TreeCache();
+ CacheImpl cache = new CacheImpl();
XmlConfigurationParser parser = new XmlConfigurationParser();
Configuration c = parser.parseFile("META-INF/replSync-service.xml");
- tree.setConfiguration(c);
+ cache.setConfiguration(c);
c.setClusterName(name);
// Use marshaller
c.setUseRegionBasedMarshalling(true);
- tree.create();
- tree.start();
- return tree;
+ cache.create();
+ cache.start();
+ return cache;
}
public void tearDown() throws Exception
1.12 +3 -3 JBossCache/tests/functional/org/jboss/cache/marshall/ActiveInactiveTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ActiveInactiveTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/marshall/ActiveInactiveTest.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- ActiveInactiveTest.java 15 Nov 2006 23:48:32 -0000 1.11
+++ ActiveInactiveTest.java 30 Dec 2006 17:49:57 -0000 1.12
@@ -8,9 +8,9 @@
package org.jboss.cache.marshall;
import junit.framework.TestCase;
+import org.jboss.cache.CacheImpl;
import org.jboss.cache.Fqn;
import org.jboss.cache.RegionManager;
-import org.jboss.cache.TreeCache;
import org.jboss.cache.Version;
import java.lang.reflect.Method;
@@ -24,13 +24,13 @@
public class ActiveInactiveTest extends TestCase
{
RegionManager rman;
- TreeCache c;
+ CacheImpl c;
@Override
protected void setUp() throws Exception
{
super.setUp();
- c = new TreeCache();
+ c = new CacheImpl();
c.getConfiguration().setUseRegionBasedMarshalling(true);
c.getConfiguration().setFetchInMemoryState(false);
c.start();
1.2 +7 -7 JBossCache/tests/functional/org/jboss/cache/marshall/ReplicateToInactiveRegionTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ReplicateToInactiveRegionTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/marshall/ReplicateToInactiveRegionTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- ReplicateToInactiveRegionTest.java 16 Nov 2006 16:51:53 -0000 1.1
+++ ReplicateToInactiveRegionTest.java 30 Dec 2006 17:49:57 -0000 1.2
@@ -1,18 +1,18 @@
package org.jboss.cache.marshall;
import junit.framework.TestCase;
-import org.jboss.cache.TreeCache;
+import org.jboss.cache.CacheImpl;
import org.jboss.cache.Fqn;
import org.jboss.cache.misc.TestingUtil;
public class ReplicateToInactiveRegionTest extends TestCase
{
- TreeCache[] caches;
+ CacheImpl[] caches;
protected void setUp() throws Exception
{
super.setUp();
- caches = new TreeCache[]{createCache(), createCache()};
+ caches = new CacheImpl[]{createCache(), createCache()};
TestingUtil.blockUntilViewsReceived(caches, 10000);
}
@@ -24,14 +24,14 @@
caches = null;
}
- private void destroyCache(TreeCache c)
+ private void destroyCache(CacheImpl c)
{
c.stop();
}
- private TreeCache createCache() throws Exception
+ private CacheImpl createCache() throws Exception
{
- TreeCache c = new TreeCache();
+ CacheImpl c = new CacheImpl();
c.getConfiguration().setCacheMode("REPL_SYNC");
c.getConfiguration().setUseRegionBasedMarshalling(true);
c.start();
1.11 +4 -4 JBossCache/tests/functional/org/jboss/cache/marshall/LocalTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LocalTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/marshall/LocalTest.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- LocalTest.java 6 Sep 2006 15:30:58 -0000 1.10
+++ LocalTest.java 30 Dec 2006 17:49:57 -0000 1.11
@@ -2,8 +2,8 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.jboss.cache.CacheImpl;
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.marshall.data.Debug;
@@ -18,11 +18,11 @@
* Simple functional tests for LegacyTreeCacheMarshaller
*
* @author Ben Wang
- * @version $Id: LocalTest.java,v 1.10 2006/09/06 15:30:58 msurtani Exp $
+ * @version $Id: LocalTest.java,v 1.11 2006/12/30 17:49:57 msurtani Exp $
*/
public class LocalTest extends RegionBasedMarshallingTestBase
{
- TreeCache cache = null;
+ CacheImpl cache = null;
Transaction tx = null;
final Fqn FQN = Fqn.fromString("/myNode");
final String KEY = "key";
@@ -33,7 +33,7 @@
protected void setUp() throws Exception
{
super.setUp();
- cache = new TreeCache();
+ cache = new CacheImpl();
cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
1.4 +2 -4 JBossCache/tests/functional/org/jboss/cache/marshall/RedeploymentEmulationTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RedeploymentEmulationTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/marshall/RedeploymentEmulationTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- RedeploymentEmulationTest.java 20 Dec 2006 13:16:27 -0000 1.3
+++ RedeploymentEmulationTest.java 30 Dec 2006 17:49:57 -0000 1.4
@@ -8,9 +8,9 @@
import junit.framework.TestCase;
import org.jboss.cache.Cache;
+import org.jboss.cache.CacheImpl;
import org.jboss.cache.Fqn;
import org.jboss.cache.Region;
-import org.jboss.cache.TreeCache;
import org.jboss.cache.config.Configuration;
import org.jgroups.Global;
@@ -35,9 +35,7 @@
protected void setUp() throws Exception
{
- TreeCache tc = new TreeCache();
-
- cache = tc.getCacheSPI();
+ cache = new CacheImpl();
cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
cache.getConfiguration().setUseRegionBasedMarshalling(true);
More information about the jboss-cvs-commits
mailing list