[jbosscache-commits] JBoss Cache SVN: r4739 - core/trunk/src/test/java/org/jboss/cache/lock/pessimistic.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Thu Nov 8 10:20:59 EST 2007


Author: mircea.markus
Date: 2007-11-08 10:20:59 -0500 (Thu, 08 Nov 2007)
New Revision: 4739

Removed:
   core/trunk/src/test/java/org/jboss/cache/lock/pessimistic/LockUpgradeTest.java
Log:
JBCACHE-1166 - normal deadlock scenario, so removing test. see JIRA for more details

Deleted: core/trunk/src/test/java/org/jboss/cache/lock/pessimistic/LockUpgradeTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/pessimistic/LockUpgradeTest.java	2007-11-08 03:55:05 UTC (rev 4738)
+++ core/trunk/src/test/java/org/jboss/cache/lock/pessimistic/LockUpgradeTest.java	2007-11-08 15:20:59 UTC (rev 4739)
@@ -1,93 +0,0 @@
-package org.jboss.cache.lock.pessimistic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.transaction.TransactionManager;
-
-import junit.framework.TestCase;
-
-import org.jboss.cache.CacheImpl;
-import org.jboss.cache.DefaultCacheFactory;
-import org.jboss.cache.config.Configuration;
-import org.jboss.cache.config.Configuration.CacheMode;
-import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
-import org.jboss.cache.transaction.DummyTransactionManager;
-import org.jboss.cache.transaction.DummyTransactionManagerLookup;
-import org.testng.annotations.Test;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.AfterMethod;
-
-/**
- * Test behaviour of concurent put/remove
- *
- * @author jhalat
- */
- at Test(groups = {"functional"}, enabled = false) // Known failure - see JBCACHE-1166 
-public class LockUpgradeTest{
-
-   private TransactionManager tm;
-
-   private CacheImpl cache;
-
-   @BeforeMethod(alwaysRun = true)
-   protected void setUp() throws Exception {
-      Configuration c = new Configuration();
-      c.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
-      cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(c);
-      tm = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
-   }
-
-   @AfterMethod(alwaysRun = true)
-   protected void tearDown() throws Exception {
-      cache.stop();
-      cache.destroy();
-   }
-
-   public void testLock() throws Exception {
-      List<WorkThread> threads = new ArrayList<WorkThread>();
-      for (int x = 0; x < 2; x++) {
-         WorkThread t = new WorkThread(x == 1);
-         threads.add(t);
-         t.start();
-      }
-      for (WorkThread separateThread : threads) {
-         separateThread.join();
-         if (separateThread.getException() != null) {
-            throw separateThread.getException();
-         }
-      }
-   }
-
-   private class WorkThread extends Thread {
-      Exception e = null;
-
-      private boolean remove;
-
-      public WorkThread(boolean remove) {
-         this.remove = remove;
-      }
-
-      public Exception getException() {
-         return e;
-      }
-
-      public void run() {
-         try {
-            for (int x = 0; x < 1000; x++) {
-               tm.begin();
-               if (remove) {
-                  cache.remove("/a/b/c/d");
-                  cache.remove("/a");
-               } else {
-                  cache.put("/a/b/c/d", "key","text" + x);
-               }
-               tm.commit();
-               Thread.sleep(1);
-            }
-         } catch (Exception e) {
-            this.e = e;
-         }
-      }
-   }
-}




More information about the jbosscache-commits mailing list