[jbosscache-commits] JBoss Cache SVN: r7571 - in core/trunk/src/test/java/org/jboss/cache: transaction/pessimistic and 1 other directory.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Thu Jan 22 14:48:46 EST 2009


Author: mircea.markus
Date: 2009-01-22 14:48:46 -0500 (Thu, 22 Jan 2009)
New Revision: 7571

Modified:
   core/trunk/src/test/java/org/jboss/cache/loader/AsyncFileCacheLoaderTest.java
   core/trunk/src/test/java/org/jboss/cache/transaction/pessimistic/ConcurrentTransactionalTest.java
Log:
more strict replication control

Modified: core/trunk/src/test/java/org/jboss/cache/loader/AsyncFileCacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/AsyncFileCacheLoaderTest.java	2009-01-22 16:36:26 UTC (rev 7570)
+++ core/trunk/src/test/java/org/jboss/cache/loader/AsyncFileCacheLoaderTest.java	2009-01-22 19:48:46 UTC (rev 7571)
@@ -28,15 +28,15 @@
 
    protected void configureCache() throws Exception
    {
-      configureCache("");
+      configureCache("", true);
    }
 
-   protected void configureCache(String props) throws Exception
+   protected void configureCache(String props, boolean async) throws Exception
    {
       cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(false, getClass());
       cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
       cache.getConfiguration().setCacheLoaderConfig(UnitTestConfigurationFactory
-            .buildSingleCacheLoaderConfig(false, "", "org.jboss.cache.loader.FileCacheLoader", props, true, false, true, false, false));
+            .buildSingleCacheLoaderConfig(false, "", "org.jboss.cache.loader.FileCacheLoader", props, async, false, true, false, false));
       cache.create();
       cache.start();
    }
@@ -84,7 +84,7 @@
       configureCache(
             "cache.async.put=false\n" +
                   "cache.async.pollWait=10000\n" +
-                  "");
+                  "", true);
       CacheLoader loader = cache.getCacheLoaderManager().getCacheLoader();
       Fqn fqn = Fqn.fromString("/a/b/c/d");
       HashMap<Object, Object> map = new HashMap<Object, Object>();
@@ -103,7 +103,7 @@
       configureCache(
             "cache.async.queueSize=1\n" +
                   "cache.async.pollWait=10\n" +
-                  "");
+                  "", true);
       CacheLoader loader = cache.getCacheLoaderManager().getCacheLoader();
       Fqn fqn = Fqn.fromString("/bound");
       loader.remove(fqn);
@@ -122,7 +122,7 @@
       configureCache(
             "cache.async.returnOld=false\n" +
                   "cache.async.pollWait=10\n" +
-                  "");
+                  "", true);
       CacheLoader loader = cache.getCacheLoaderManager().getCacheLoader();
       cache.put(Fqn.ROOT, "key1", "value1");
       Thread.sleep(100);
@@ -133,12 +133,11 @@
 
    public void testStoreState() throws Exception
    {
-      configureCache();
+      configureCache("", false);
       Fqn X = Fqn.fromString("/x");
       CacheLoader loader = cache.getCacheLoaderManager().getCacheLoader();
       loader.remove(X);
       cache.put(X, "key1", "value1");
-      Thread.sleep(1000);
       ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
       MarshalledValueOutputStream os = new MarshalledValueOutputStream(baos);
       loader.loadEntireState(os);
@@ -160,7 +159,7 @@
       configureCache(
             "cache.async.queueSize=1\n" +
                   "cache.async.pollWait=10\n" +
-                  "cache.async.threadPoolSize=5");
+                  "cache.async.threadPoolSize=5", true);
       CacheLoader loader = cache.getCacheLoaderManager().getCacheLoader();
       Fqn fqn = Fqn.fromString("/bound");
       loader.remove(fqn);

Modified: core/trunk/src/test/java/org/jboss/cache/transaction/pessimistic/ConcurrentTransactionalTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/transaction/pessimistic/ConcurrentTransactionalTest.java	2009-01-22 16:36:26 UTC (rev 7570)
+++ core/trunk/src/test/java/org/jboss/cache/transaction/pessimistic/ConcurrentTransactionalTest.java	2009-01-22 19:48:46 UTC (rev 7571)
@@ -41,7 +41,7 @@
    private volatile CacheSPI<Integer, String> cache;
    private Log logger_ = LogFactory.getLog(ConcurrentTransactionalTest.class);
    private volatile Throwable thread_ex = null;
-   private static final int NUM = 10000;
+   private static final int NUM = 1000;
    Log log = LogFactory.getLog(ConcurrentTransactionalTest.class);
 
    private void createCache(IsolationLevel level)
@@ -166,7 +166,7 @@
             tx = TransactionSetup.getUserTransaction();
             for (int i = 0; i < NUM; i++)
             {
-               log("adding data i=" + i);
+               log(cache + " adding data i=" + i);
                tx.begin();
                cache.put("/a/b/c", i, val);
                tx.commit();
@@ -175,7 +175,7 @@
          }
          catch (Throwable t)
          {
-            t.printStackTrace();
+            log.error("cache = " + cache + ", tx = " + tx+ t);
             thread_ex = t;
          }
       }




More information about the jbosscache-commits mailing list