[jbosscache-commits] JBoss Cache SVN: r7074 - in core/trunk/src/test/java/org/jboss/cache: loader and 2 other directories.
jbosscache-commits at lists.jboss.org
jbosscache-commits at lists.jboss.org
Tue Nov 4 03:23:33 EST 2008
Author: dpospisi at redhat.com
Date: 2008-11-04 03:23:33 -0500 (Tue, 04 Nov 2008)
New Revision: 7074
Modified:
core/trunk/src/test/java/org/jboss/cache/UnitTestCacheFactory.java
core/trunk/src/test/java/org/jboss/cache/loader/JDBCCacheLoaderStateTransferTest.java
core/trunk/src/test/java/org/jboss/cache/loader/TcpCacheServerTest.java
core/trunk/src/test/java/org/jboss/cache/marshall/SimpleArrayReplTest.java
core/trunk/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java
Log:
More fixes for parallel testing. (DefaultCacheFactory -> UnitTestCacheFactory)
Modified: core/trunk/src/test/java/org/jboss/cache/UnitTestCacheFactory.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/UnitTestCacheFactory.java 2008-11-04 07:35:22 UTC (rev 7073)
+++ core/trunk/src/test/java/org/jboss/cache/UnitTestCacheFactory.java 2008-11-04 08:23:33 UTC (rev 7074)
@@ -154,6 +154,7 @@
break;
default:
log.info("Unknown cache mode!");
+ System.exit(0);
}
Cache<K, V> cache = new DefaultCacheFactory<K, V>().createCache(configuration, start);
Modified: core/trunk/src/test/java/org/jboss/cache/loader/JDBCCacheLoaderStateTransferTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/JDBCCacheLoaderStateTransferTest.java 2008-11-04 07:35:22 UTC (rev 7073)
+++ core/trunk/src/test/java/org/jboss/cache/loader/JDBCCacheLoaderStateTransferTest.java 2008-11-04 08:23:33 UTC (rev 7074)
@@ -22,8 +22,8 @@
package org.jboss.cache.loader;
import org.jboss.cache.CacheSPI;
-import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
+import org.jboss.cache.UnitTestCacheFactory;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Configuration.CacheMode;
@@ -79,11 +79,11 @@
public void testSimpleStateTransfer() throws Exception
{
- first = (CacheSPI) new DefaultCacheFactory().createCache(getConfiguration(0));
+ first = (CacheSPI) new UnitTestCacheFactory().createCache(getConfiguration(0));
first.put("/a/b/c", "key", "value");
first.put("/a/b/d", "key", "value");
first.put("/a/b/e", "key", "value");
- second = (CacheSPI) new DefaultCacheFactory().createCache(getConfiguration(2));
+ second = (CacheSPI) new UnitTestCacheFactory().createCache(getConfiguration(2));
assert second.get("/a/b/c","key").equals("value");
assert second.get("/a/b/d","key").equals("value");
assert second.get("/a/b/e","key").equals("value");
@@ -97,7 +97,7 @@
{
long startTime = System.currentTimeMillis();
- first = (CacheSPI) new DefaultCacheFactory().createCache(getConfiguration(0));
+ first = (CacheSPI) new UnitTestCacheFactory().createCache(getConfiguration(0));
long cacheStartTime = System.currentTimeMillis() - startTime;
System.out.println("cacheStartTime = " + cacheStartTime);
for (int i = 0; i < 5012; i++)
@@ -106,7 +106,7 @@
if (i%1000 == 0) System.out.println(i + " operations executed so far");
}
startTime = System.currentTimeMillis();
- second = (CacheSPI) new DefaultCacheFactory().createCache(getConfiguration(2));
+ second = (CacheSPI) new UnitTestCacheFactory().createCache(getConfiguration(2));
long stateTranferTime = System.currentTimeMillis() - startTime - cacheStartTime;
for (int i = 0; i < 5012; i+=100)
Modified: core/trunk/src/test/java/org/jboss/cache/loader/TcpCacheServerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/TcpCacheServerTest.java 2008-11-04 07:35:22 UTC (rev 7073)
+++ core/trunk/src/test/java/org/jboss/cache/loader/TcpCacheServerTest.java 2008-11-04 08:23:33 UTC (rev 7074)
@@ -2,7 +2,6 @@
import org.jboss.cache.Cache;
import org.jboss.cache.CacheSPI;
-import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.Configuration;
@@ -16,6 +15,7 @@
import org.testng.annotations.Test;
import java.net.UnknownHostException;
+import org.jboss.cache.UnitTestCacheFactory;
/**
* Tests various ways of setting up the TcpCacheServer
@@ -53,7 +53,7 @@
c.setCacheMode(Configuration.CacheMode.LOCAL);
c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
c.setCacheLoaderConfig(getCacheLoaderConfig());
- cache = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(c);
+ cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c);
cache.start();
loader = cache.getCacheLoaderManager().getCacheLoader();
@@ -121,7 +121,7 @@
{
createTcpCacheServer();
Configuration conf = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
- CacheSPI cacheSPI = (CacheSPI) new DefaultCacheFactory<Object, Object>().createCache(conf);
+ CacheSPI cacheSPI = (CacheSPI) new UnitTestCacheFactory<Object, Object>().createCache(conf);
cache_server.setCache(cacheSPI);
startTcpCacheServer();
createCacheAndLoader();
@@ -133,7 +133,7 @@
{
createTcpCacheServer();
Configuration conf = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
- CacheSPI cacheSPI = (CacheSPI) new DefaultCacheFactory<Object, Object>().createCache(conf);
+ CacheSPI cacheSPI = (CacheSPI) new UnitTestCacheFactory<Object, Object>().createCache(conf);
cache_server.setCache(cacheSPI);
startTcpCacheServer();
createCacheAndLoader();
@@ -145,7 +145,7 @@
{
createTcpCacheServer();
Configuration conf = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
- CacheSPI cacheSPI = (CacheSPI) new DefaultCacheFactory<Object, Object>().createCache(conf);
+ CacheSPI cacheSPI = (CacheSPI) new UnitTestCacheFactory<Object, Object>().createCache(conf);
CacheJmxWrapper wrapper = new CacheJmxWrapper<Object, Object>(cacheSPI);
wrapper.start();
cache_server.setCacheJmxWrapper(wrapper);
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/SimpleArrayReplTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/SimpleArrayReplTest.java 2008-11-04 07:35:22 UTC (rev 7073)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/SimpleArrayReplTest.java 2008-11-04 08:23:33 UTC (rev 7074)
@@ -1,7 +1,6 @@
package org.jboss.cache.marshall;
import org.jboss.cache.Cache;
-import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Configuration.CacheMode;
@@ -11,6 +10,7 @@
import java.util.Arrays;
import java.util.Random;
+import org.jboss.cache.UnitTestCacheFactory;
@Test(groups = "functional")
public class SimpleArrayReplTest
@@ -27,8 +27,8 @@
Configuration c = new Configuration();
c.setCacheMode(CacheMode.REPL_SYNC);
c.setNodeLockingScheme(NodeLockingScheme.MVCC);
- cache1 = new DefaultCacheFactory<String, byte[]>().createCache(c.clone());
- cache2 = new DefaultCacheFactory<String, byte[]>().createCache(c.clone());
+ cache1 = new UnitTestCacheFactory<String, byte[]>().createCache(c.clone());
+ cache2 = new UnitTestCacheFactory<String, byte[]>().createCache(c.clone());
TestingUtil.blockUntilViewsReceived(60000, cache1, cache2);
Modified: core/trunk/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java 2008-11-04 07:35:22 UTC (rev 7073)
+++ core/trunk/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java 2008-11-04 08:23:33 UTC (rev 7074)
@@ -51,7 +51,7 @@
configuration.setCacheMode(Configuration.CacheMode.LOCAL);
configuration.setTransactionManagerLookupClass("org.jboss.cache.transaction.GenericTransactionManagerLookup");
configuration.setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
- cache = (CacheSPI) new DefaultCacheFactory().createCache(configuration);
+ cache = (CacheSPI) new UnitTestCacheFactory().createCache(configuration);
dataContainer = (DataContainerImpl) cache.getComponentRegistry().getComponent(DataContainer.class);
}
More information about the jbosscache-commits
mailing list