[jbosscache-commits] JBoss Cache SVN: r4867 - in core/trunk/src: test/java/org/jboss/cache and 8 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Sun Dec 16 12:38:31 EST 2007


Author: manik.surtani at jboss.com
Date: 2007-12-16 12:38:31 -0500 (Sun, 16 Dec 2007)
New Revision: 4867

Modified:
   core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java
   core/trunk/src/test/java/org/jboss/cache/LifeCycleTest.java
   core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationWithCacheLoaderTest.java
   core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationWithPassivationTest.java
   core/trunk/src/test/java/org/jboss/cache/eviction/ExpirationPolicyTest.java
   core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java
   core/trunk/src/test/java/org/jboss/cache/mgmt/CacheLoaderTest.java
   core/trunk/src/test/java/org/jboss/cache/mgmt/MgmtTestBase.java
   core/trunk/src/test/java/org/jboss/cache/multiplexer/BuddyGroupAssignmentTest.java
   core/trunk/src/test/java/org/jboss/cache/options/TestVersion.java
   core/trunk/src/test/java/org/jboss/cache/passivation/BasicPassivationTest.java
   core/trunk/src/test/java/org/jboss/cache/passivation/ConcurrentPassivationTest.java
   core/trunk/src/test/java/org/jboss/cache/transaction/ReplicatedTransactionDeadlockTest.java
Log:
Updated tests

Modified: core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java	2007-12-16 14:49:16 UTC (rev 4866)
+++ core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java	2007-12-16 17:38:31 UTC (rev 4867)
@@ -657,4 +657,12 @@
          throw new ConfigurationException("Unable to build interceptor chain", e);
       }
    }
+
+   public static InterceptorChainFactory getInstance(ComponentRegistry componentRegistry, Configuration configuration)
+   {
+      InterceptorChainFactory icf = new InterceptorChainFactory();
+      icf.componentRegistry = componentRegistry;
+      icf.configuration = configuration;
+      return icf;
+   }
 }

Modified: core/trunk/src/test/java/org/jboss/cache/LifeCycleTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/LifeCycleTest.java	2007-12-16 14:49:16 UTC (rev 4866)
+++ core/trunk/src/test/java/org/jboss/cache/LifeCycleTest.java	2007-12-16 17:38:31 UTC (rev 4867)
@@ -1,7 +1,5 @@
 package org.jboss.cache;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.config.Configuration;
 import org.jboss.cache.misc.TestingUtil;
 import org.jboss.cache.notifications.annotation.CacheListener;
@@ -28,7 +26,6 @@
 @Test(groups = {"functional"})
 public class LifeCycleTest
 {
-   private static Log log = LogFactory.getLog(LifeCycleTest.class);
    private CacheSPI[] c;
 
    @AfterMethod

Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationWithCacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationWithCacheLoaderTest.java	2007-12-16 14:49:16 UTC (rev 4866)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationWithCacheLoaderTest.java	2007-12-16 17:38:31 UTC (rev 4867)
@@ -29,7 +29,7 @@
  *
  * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
  */
- at Test(groups = {"functional"})
+ at Test(groups = "functional")
 public class BuddyReplicationWithCacheLoaderTest extends BuddyReplicationTestsBase
 {
 

Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationWithPassivationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationWithPassivationTest.java	2007-12-16 14:49:16 UTC (rev 4866)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationWithPassivationTest.java	2007-12-16 17:38:31 UTC (rev 4867)
@@ -6,15 +6,16 @@
  */
 package org.jboss.cache.buddyreplication;
 
+import org.testng.annotations.Test;
+
 /**
  * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
  */
+ at Test(groups = "functional")
 public class BuddyReplicationWithPassivationTest extends BuddyReplicationWithCacheLoaderTest
 {
    public BuddyReplicationWithPassivationTest()
    {
       passivation = true;
    }
-
-
 }

Modified: core/trunk/src/test/java/org/jboss/cache/eviction/ExpirationPolicyTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/eviction/ExpirationPolicyTest.java	2007-12-16 14:49:16 UTC (rev 4866)
+++ core/trunk/src/test/java/org/jboss/cache/eviction/ExpirationPolicyTest.java	2007-12-16 17:38:31 UTC (rev 4867)
@@ -45,7 +45,7 @@
    @BeforeMethod(alwaysRun = true)
    public void setUp() throws Exception
    {
-      Configuration conf = cache.getConfiguration();
+      Configuration conf = new Configuration();
       EvictionConfig econf = new EvictionConfig(ExpirationPolicy.class.getName());
       econf.setWakeupIntervalSeconds(1);
       conf.setEvictionConfig(econf);

Modified: core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java	2007-12-16 14:49:16 UTC (rev 4866)
+++ core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java	2007-12-16 17:38:31 UTC (rev 4867)
@@ -1,12 +1,14 @@
 package org.jboss.cache.factories;
 
 import junit.framework.Assert;
-import org.jboss.cache.CacheImpl;
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheSPI;
 import org.jboss.cache.DefaultCacheFactory;
 import org.jboss.cache.config.BuddyReplicationConfig;
 import org.jboss.cache.config.CacheLoaderConfig;
 import org.jboss.cache.config.EvictionConfig;
 import org.jboss.cache.interceptors.*;
+import org.jboss.cache.misc.TestingUtil;
 import org.jboss.cache.xml.XmlHelper;
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertNotNull;
@@ -21,12 +23,12 @@
 @Test(groups = {"functional"})
 public class InterceptorChainFactoryTest extends InterceptorChainTestBase
 {
-   CacheImpl cache = null;
+   CacheSPI cache = null;
 
    @BeforeMethod(alwaysRun = true)
    public void setUp() throws Exception
    {
-      cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
+      cache = (CacheSPI) DefaultCacheFactory.getInstance().createCache(false);
       cache.getConfiguration().setCacheMode("LOCAL");
    }
 
@@ -43,8 +45,8 @@
    public void testBareConfig() throws Exception
    {
       cache.getConfiguration().setExposeManagementStatistics(false);
-      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain();
-      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
+      Interceptor chain = getInterceptorChainFactory(cache).buildInterceptorChain();
+      List<Interceptor> list = getInterceptorChainFactory(cache).asList(chain);
       Iterator<Interceptor> interceptors = list.iterator();
 
       System.out.println("testBareConfig interceptors are:\n" + list);
@@ -67,8 +69,8 @@
       cache.getConfiguration().setExposeManagementStatistics(false);
       cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
 
-      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain();
-      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
+      Interceptor chain = getInterceptorChainFactory(cache).buildInterceptorChain();
+      List<Interceptor> list = getInterceptorChainFactory(cache).asList(chain);
       Iterator<Interceptor> interceptors = list.iterator();
 
       System.out.println("testTxConfig interceptors are:\n" + list);
@@ -115,8 +117,8 @@
       cache.getConfiguration().setCacheMode("REPL_ASYNC");
       cache.getConfiguration().setFetchInMemoryState(false);
       cache.create();
-      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain();
-      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
+      Interceptor chain = getInterceptorChainFactory(cache).buildInterceptorChain();
+      List<Interceptor> list = getInterceptorChainFactory(cache).asList(chain);
       Iterator<Interceptor> interceptors = list.iterator();
 
       System.out.println("testSharedCacheLoaderConfig interceptors are:\n" + list);
@@ -145,8 +147,8 @@
       cache.getConfiguration().setCacheMode("REPL_ASYNC");
       cache.getConfiguration().setFetchInMemoryState(false);
       cache.create();
-      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain();
-      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
+      Interceptor chain = getInterceptorChainFactory(cache).buildInterceptorChain();
+      List<Interceptor> list = getInterceptorChainFactory(cache).asList(chain);
       Iterator<Interceptor> interceptors = list.iterator();
 
       System.out.println("testUnsharedCacheLoaderConfig interceptors are:\n" + list);
@@ -172,8 +174,8 @@
       cache.getConfiguration().setExposeManagementStatistics(false);
       cache.getConfiguration().setCacheMode("repl_sync");
       cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
-      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain();
-      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
+      Interceptor chain = getInterceptorChainFactory(cache).buildInterceptorChain();
+      List<Interceptor> list = getInterceptorChainFactory(cache).asList(chain);
       Iterator<Interceptor> interceptors = list.iterator();
 
       System.out.println("testTxAndRepl interceptors are:\n" + list);
@@ -195,14 +197,14 @@
 
    public void testOptimisticChain() throws Exception
    {
-      CacheImpl cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
+      CacheSPI cache = (CacheSPI) DefaultCacheFactory.getInstance().createCache(false);
       cache.getConfiguration().setExposeManagementStatistics(false);
       cache.getConfiguration().setNodeLockingOptimistic(true);
 
-      Interceptor next = InterceptorChainFactory.getInstance().buildInterceptorChain();
+      Interceptor next = getInterceptorChainFactory(cache).buildInterceptorChain();
 
       // test the chain size.
-      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(next);
+      List<Interceptor> list = getInterceptorChainFactory(cache).asList(next);
       Iterator<Interceptor> interceptors = list.iterator();
 
       Assert.assertEquals(8, list.size());
@@ -221,15 +223,15 @@
 
    public void testOptimisticReplicatedChain() throws Exception
    {
-      CacheImpl cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
+      CacheSPI cache = (CacheSPI) DefaultCacheFactory.getInstance().createCache(false);
       cache.getConfiguration().setExposeManagementStatistics(false);
       cache.getConfiguration().setNodeLockingOptimistic(true);
       cache.getConfiguration().setCacheMode("REPL_SYNC");
 
-      Interceptor next = InterceptorChainFactory.getInstance().buildInterceptorChain();
+      Interceptor next = getInterceptorChainFactory(cache).buildInterceptorChain();
 
       // test the chain size.
-      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(next);
+      List<Interceptor> list = getInterceptorChainFactory(cache).asList(next);
       Iterator<Interceptor> interceptors = list.iterator();
 
       Assert.assertEquals(9, list.size());
@@ -249,15 +251,15 @@
 
    public void testOptimisticCacheLoaderChain() throws Exception
    {
-      CacheImpl cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
+      CacheSPI cache = (CacheSPI) DefaultCacheFactory.getInstance().createCache(false);
       cache.getConfiguration().setExposeManagementStatistics(false);
       cache.getConfiguration().setNodeLockingOptimistic(true);
       cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig(false, false));
       cache.create();
-      Interceptor next = InterceptorChainFactory.getInstance().buildInterceptorChain();
+      Interceptor next = getInterceptorChainFactory(cache).buildInterceptorChain();
 
       // test the chain size.
-      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(next);
+      List<Interceptor> list = getInterceptorChainFactory(cache).asList(next);
       Iterator<Interceptor> interceptors = list.iterator();
 
       Assert.assertEquals(10, list.size());
@@ -278,20 +280,19 @@
 
    public void testOptimisticPassivationCacheLoaderChain() throws Exception
    {
-      CacheImpl cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
+      CacheSPI cache = (CacheSPI) DefaultCacheFactory.getInstance().createCache(false);
       cache.getConfiguration().setExposeManagementStatistics(false);
       cache.getConfiguration().setNodeLockingOptimistic(true);
       cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig(true, false));
       cache.create();
-      Interceptor next = InterceptorChainFactory.getInstance().buildInterceptorChain();
+      Interceptor next = getInterceptorChainFactory(cache).buildInterceptorChain();
 
       // test the chain size.
-      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(next);
+      List<Interceptor> list = getInterceptorChainFactory(cache).asList(next);
       Iterator<Interceptor> interceptors = list.iterator();
 
       Assert.assertEquals(10, list.size());
 
-
       assertEquals(InvocationContextInterceptor.class, interceptors.next().getClass());
       assertEquals(TxInterceptor.class, interceptors.next().getClass());
       assertEquals(NotificationInterceptor.class, interceptors.next().getClass());
@@ -308,14 +309,14 @@
 
    public void testInvalidationInterceptorChain() throws Exception
    {
-      CacheImpl cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
+      CacheSPI cache = (CacheSPI) DefaultCacheFactory.getInstance().createCache(false);
       cache.getConfiguration().setExposeManagementStatistics(false);
       cache.getConfiguration().setCacheMode("REPL_ASYNC");
 
-      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain();
+      Interceptor chain = getInterceptorChainFactory(cache).buildInterceptorChain();
 
       // test the chain size.
-      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
+      List<Interceptor> list = getInterceptorChainFactory(cache).asList(chain);
       Iterator<Interceptor> interceptors = list.iterator();
 
       Assert.assertEquals(7, list.size());
@@ -331,13 +332,13 @@
       // ok, my replication chain looks good.
 
       // now for my invalidation chain.
-      cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
+      cache = (CacheSPI) DefaultCacheFactory.getInstance().createCache(false);
       cache.getConfiguration().setExposeManagementStatistics(false);
       cache.getConfiguration().setCacheMode("INVALIDATION_ASYNC");
-      chain = InterceptorChainFactory.getInstance().buildInterceptorChain();
+      chain = getInterceptorChainFactory(cache).buildInterceptorChain();
 
       // test the chain size.
-      list = InterceptorChainFactory.getInstance().asList(chain);
+      list = getInterceptorChainFactory(cache).asList(chain);
       interceptors = list.iterator();
 
       Assert.assertEquals(7, list.size());
@@ -356,8 +357,8 @@
    public void testCacheMgmtConfig() throws Exception
    {
       cache.getConfiguration().setExposeManagementStatistics(true);
-      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain();
-      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
+      Interceptor chain = getInterceptorChainFactory(cache).buildInterceptorChain();
+      List<Interceptor> list = getInterceptorChainFactory(cache).asList(chain);
       Iterator<Interceptor> interceptors = list.iterator();
 
       System.out.println("testCacheMgmtConfig interceptors are:\n" + list);
@@ -388,8 +389,8 @@
          }
       }
       );
-      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain();
-      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
+      Interceptor chain = getInterceptorChainFactory(cache).buildInterceptorChain();
+      List<Interceptor> list = getInterceptorChainFactory(cache).asList(chain);
       Iterator<Interceptor> interceptors = list.iterator();
 
       System.out.println("testEvictionInterceptorConfig interceptors are:\n" + list);
@@ -424,9 +425,9 @@
       cache.getConfiguration().setCacheMode("REPL_SYNC");
       cache.getConfiguration().setNodeLockingScheme("OPTIMISTIC");
       cache.create();// initialise various subsystems such as BRManager
-      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain();
+      Interceptor chain = getInterceptorChainFactory(cache).buildInterceptorChain();
 
-      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
+      List<Interceptor> list = getInterceptorChainFactory(cache).asList(chain);
       Iterator<Interceptor> interceptors = list.iterator();
 
       System.out.println("testEvictionInterceptorConfig interceptors are:\n" + list);
@@ -463,9 +464,9 @@
 
       cache.getConfiguration().setCacheMode("REPL_SYNC");
       cache.create();// initialise various subsystems such as BRManager
-      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain();
+      Interceptor chain = getInterceptorChainFactory(cache).buildInterceptorChain();
 
-      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
+      List<Interceptor> list = getInterceptorChainFactory(cache).asList(chain);
       Iterator<Interceptor> interceptors = list.iterator();
 
       System.out.println("testEvictionInterceptorConfig interceptors are:\n" + list);
@@ -485,4 +486,8 @@
       assertInterceptorLinkage(list);
    }
 
+   private InterceptorChainFactory getInterceptorChainFactory(Cache cache)
+   {
+      return InterceptorChainFactory.getInstance(TestingUtil.extractComponentRegistry(cache), cache.getConfiguration());
+   }
 }

Modified: core/trunk/src/test/java/org/jboss/cache/mgmt/CacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/mgmt/CacheLoaderTest.java	2007-12-16 14:49:16 UTC (rev 4866)
+++ core/trunk/src/test/java/org/jboss/cache/mgmt/CacheLoaderTest.java	2007-12-16 17:38:31 UTC (rev 4867)
@@ -1,22 +1,20 @@
 package org.jboss.cache.mgmt;
 
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertNull;
-
-import java.util.HashMap;
-
 import org.jboss.cache.interceptors.CacheLoaderInterceptor;
 import org.jboss.cache.interceptors.CacheStoreInterceptor;
 import org.jboss.cache.misc.TestingUtil;
+import static org.testng.AssertJUnit.*;
+import org.testng.annotations.Test;
 
+import java.util.HashMap;
+
 /**
  * Simple functional tests for CacheLoaderInterceptor and CacheStoreInterceptor statistics
  *
  * @author Jerry Gauthier
  * @version $Id$
  */
+ at Test(groups = "functional")
 public class CacheLoaderTest extends MgmtTestBase
 {
    public void testCacheLoaderMgmt() throws Exception

Modified: core/trunk/src/test/java/org/jboss/cache/mgmt/MgmtTestBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/mgmt/MgmtTestBase.java	2007-12-16 14:49:16 UTC (rev 4866)
+++ core/trunk/src/test/java/org/jboss/cache/mgmt/MgmtTestBase.java	2007-12-16 17:38:31 UTC (rev 4867)
@@ -1,8 +1,5 @@
 package org.jboss.cache.mgmt;
 
-import java.util.HashMap;
-import java.util.Map;
-
 import org.jboss.cache.CacheFactory;
 import org.jboss.cache.CacheSPI;
 import org.jboss.cache.DefaultCacheFactory;
@@ -18,7 +15,10 @@
 import org.testng.annotations.Test;
 import org.w3c.dom.Element;
 
- at Test(groups = {"functional"})
+import java.util.HashMap;
+import java.util.Map;
+
+ at Test(groups = "functional")
 public abstract class MgmtTestBase
 {
    protected static final String CAPITAL = "capital";
@@ -94,10 +94,12 @@
    private CacheSPI<String, Object> createCache() throws Exception
    {
       CacheFactory<String, Object> instance = DefaultCacheFactory.getInstance();
-      CacheSPI<String, Object> cache = (CacheSPI<String, Object>) instance.createCache(false);
-      cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
-      cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig());
-      cache.getConfiguration().setExposeManagementStatistics(true);
+      Configuration c = new Configuration();
+      c.setCacheMode(Configuration.CacheMode.LOCAL);
+      c.setCacheLoaderConfig(getCacheLoaderConfig());
+      c.setExposeManagementStatistics(true);
+
+      CacheSPI<String, Object> cache = (CacheSPI<String, Object>) instance.createCache(c, false);
       cache.create();
       cache.start();
       return cache;
@@ -106,17 +108,17 @@
    private CacheLoaderConfig getCacheLoaderConfig() throws Exception
    {
       String xml = "<config>\n" +
-              "<passivation>" + passivation + "</passivation>\n" +
-              "<preload></preload>\n" +
-              "<shared>false</shared>\n" +
-              "<cacheloader>\n" +
-              "<class>" + DummyInMemoryCacheLoader.class.getName() + "</class>\n" +
-              "<properties>debug=true</properties>\n" +
-              "<async>false</async>\n" +
-              "<fetchPersistentState>false</fetchPersistentState>\n" +
-              "<ignoreModifications>false</ignoreModifications>\n" +
-              "</cacheloader>\n" +
-              "</config>";
+            "<passivation>" + passivation + "</passivation>\n" +
+            "<preload></preload>\n" +
+            "<shared>false</shared>\n" +
+            "<cacheloader>\n" +
+            "<class>" + DummyInMemoryCacheLoader.class.getName() + "</class>\n" +
+            "<properties>debug=true</properties>\n" +
+            "<async>false</async>\n" +
+            "<fetchPersistentState>false</fetchPersistentState>\n" +
+            "<ignoreModifications>false</ignoreModifications>\n" +
+            "</cacheloader>\n" +
+            "</config>";
       Element element = XmlHelper.stringToElement(xml);
       return XmlConfigurationParser.parseCacheLoaderConfig(element);
    }

Modified: core/trunk/src/test/java/org/jboss/cache/multiplexer/BuddyGroupAssignmentTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/multiplexer/BuddyGroupAssignmentTest.java	2007-12-16 14:49:16 UTC (rev 4866)
+++ core/trunk/src/test/java/org/jboss/cache/multiplexer/BuddyGroupAssignmentTest.java	2007-12-16 17:38:31 UTC (rev 4867)
@@ -34,13 +34,12 @@
  * @version $Revision$
  */
 @Test(enabled = true)
-public class BuddyGroupAssignmentTest
-   extends org.jboss.cache.buddyreplication.BuddyGroupAssignmentTest
+public class BuddyGroupAssignmentTest extends org.jboss.cache.buddyreplication.BuddyGroupAssignmentTest
 {
    private MultiplexerTestHelper muxHelper;
 
    @BeforeMethod(alwaysRun = true)
-   public  void setUp() throws Exception
+   public void setUp() throws Exception
    {
       muxHelper = new MultiplexerTestHelper();
    }

Modified: core/trunk/src/test/java/org/jboss/cache/options/TestVersion.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/options/TestVersion.java	2007-12-16 14:49:16 UTC (rev 4866)
+++ core/trunk/src/test/java/org/jboss/cache/options/TestVersion.java	2007-12-16 17:38:31 UTC (rev 4867)
@@ -7,9 +7,8 @@
  */
 public class TestVersion implements DataVersion
 {
-   
    private static final long serialVersionUID = -5577530957664493161L;
-   
+
    private String myVersion;
 
    public TestVersion(String version)

Modified: core/trunk/src/test/java/org/jboss/cache/passivation/BasicPassivationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/passivation/BasicPassivationTest.java	2007-12-16 14:49:16 UTC (rev 4866)
+++ core/trunk/src/test/java/org/jboss/cache/passivation/BasicPassivationTest.java	2007-12-16 17:38:31 UTC (rev 4867)
@@ -8,7 +8,7 @@
 package org.jboss.cache.passivation;
 
 import org.jboss.cache.CacheFactory;
-import org.jboss.cache.CacheImpl;
+import org.jboss.cache.CacheSPI;
 import org.jboss.cache.DefaultCacheFactory;
 import org.jboss.cache.Fqn;
 import org.jboss.cache.factories.XmlConfigurationParser;
@@ -31,7 +31,7 @@
 @Test(groups = {"functional"})
 public class BasicPassivationTest
 {
-   CacheImpl cache;
+   CacheSPI cache;
    int wakeupIntervalMillis_ = 0;
    final String ROOT_STR = "/test";
    Throwable t1_ex, t2_ex;
@@ -59,7 +59,7 @@
    private void initCaches()
    {
       CacheFactory<String, String> instance = DefaultCacheFactory.getInstance();
-      cache = (CacheImpl) instance.createCache(new XmlConfigurationParser().parseFile("META-INF/local-passivation-service.xml"), false);
+      cache = (CacheSPI) instance.createCache(new XmlConfigurationParser().parseFile("META-INF/local-passivation-service.xml"), false);
       cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
       Object listener = new TestCacheListener();
       cache.getConfiguration().getCacheLoaderConfig().getFirstCacheLoaderConfig().setClassName(DummyInMemoryCacheLoader.class.getName());
@@ -92,7 +92,7 @@
       System.out.println(cache.toString());
       try
       {
-         assertFalse(cache.exists(FQNSTR, FQNSTR));
+         assert !(cache.exists(FQNSTR) && cache.getNode(FQNSTR).getKeys().contains(FQNSTR));
          Object val = cache.get(FQNSTR, FQNSTR);
          assertNotNull("DataNode should not be empty ", val);
       }

Modified: core/trunk/src/test/java/org/jboss/cache/passivation/ConcurrentPassivationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/passivation/ConcurrentPassivationTest.java	2007-12-16 14:49:16 UTC (rev 4866)
+++ core/trunk/src/test/java/org/jboss/cache/passivation/ConcurrentPassivationTest.java	2007-12-16 17:38:31 UTC (rev 4867)
@@ -8,7 +8,7 @@
 package org.jboss.cache.passivation;
 
 import org.jboss.cache.CacheFactory;
-import org.jboss.cache.CacheImpl;
+import org.jboss.cache.CacheSPI;
 import org.jboss.cache.DefaultCacheFactory;
 import org.jboss.cache.Fqn;
 import org.jboss.cache.factories.XmlConfigurationParser;
@@ -29,14 +29,14 @@
 @Test(groups = {"functional"})
 public class ConcurrentPassivationTest
 {
-   private CacheImpl cache_;
+   private CacheSPI cache;
    private int wakeupIntervalMillis_ = 0;
 
    @BeforeMethod(alwaysRun = true)
    public void setUp() throws Exception
    {
       initCaches();
-      wakeupIntervalMillis_ = cache_.getConfiguration().getEvictionConfig().getWakeupIntervalSeconds() * 1000;
+      wakeupIntervalMillis_ = cache.getConfiguration().getEvictionConfig().getWakeupIntervalSeconds() * 1000;
       if (wakeupIntervalMillis_ < 0)
       {
          fail("testEviction(): eviction thread wake up interval is illegal " + wakeupIntervalMillis_);
@@ -47,17 +47,17 @@
    private void initCaches()
    {
       CacheFactory<Integer, String> instance = DefaultCacheFactory.getInstance();
-      cache_ = (CacheImpl) instance.createCache(new XmlConfigurationParser().parseFile("META-INF/local-passivation-service.xml"), false);
-      cache_.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
-      cache_.getConfiguration().getCacheLoaderConfig().getFirstCacheLoaderConfig().setClassName(DummyInMemoryCacheLoader.class.getName());
-      cache_.start();
+      cache = (CacheSPI) instance.createCache(new XmlConfigurationParser().parseFile("META-INF/local-passivation-service.xml"), false);
+      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
+      cache.getConfiguration().getCacheLoaderConfig().getFirstCacheLoaderConfig().setClassName(DummyInMemoryCacheLoader.class.getName());
+      cache.start();
    }
 
    @AfterMethod(alwaysRun = true)
    public void tearDown() throws Exception
    {
-      cache_.stop();
-      cache_ = null;
+      cache.stop();
+      cache = null;
    }
 
    public void testConcurrentPassivation() throws Exception
@@ -68,7 +68,7 @@
       // region's maxNodes so we know eviction will kick in
       for (int i = 0; i < 35000; i++)
       {
-         cache_.put(new Fqn<Object>(base, i / 100), i, "value");
+         cache.put(new Fqn<Object>(base, i / 100), i, "value");
       }
 
       // Loop for long enough to have 5 runs of the eviction thread
@@ -82,7 +82,7 @@
          for (int i = 0; i < 35000; i++)
          {
             Fqn<Object> fqn = new Fqn<Object>(base, i / 100);
-            assertNotNull("Get on Fqn " + fqn + " returned null", cache_.get(fqn));
+            assertNotNull("Get on Fqn " + fqn + " returned null", cache.getNode(fqn));
          }
       }
    }

Modified: core/trunk/src/test/java/org/jboss/cache/transaction/ReplicatedTransactionDeadlockTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/transaction/ReplicatedTransactionDeadlockTest.java	2007-12-16 14:49:16 UTC (rev 4866)
+++ core/trunk/src/test/java/org/jboss/cache/transaction/ReplicatedTransactionDeadlockTest.java	2007-12-16 17:38:31 UTC (rev 4867)
@@ -3,7 +3,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.CacheFactory;
-import org.jboss.cache.CacheImpl;
 import org.jboss.cache.CacheSPI;
 import org.jboss.cache.DefaultCacheFactory;
 import org.jboss.cache.Fqn;
@@ -86,7 +85,7 @@
    /**
     * The target cache where we replicate modifications.
     */
-   private CacheImpl dstCache = null;
+   private CacheSPI dstCache = null;
 
    private Log log = LogFactory.getLog(ReplicatedTransactionDeadlockTest.class);
 
@@ -114,7 +113,7 @@
       srcCache.create();
       srcCache.start();
       // setup and start the destination cache
-      dstCache = (CacheImpl) instance.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
+      dstCache = (CacheSPI) instance.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
       dstCache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
       dstCache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
 




More information about the jbosscache-commits mailing list