[jboss-cvs] JBossAS SVN: r107811 - in branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster: testutil and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Aug 26 14:41:53 EDT 2010


Author: smarlow at redhat.com
Date: 2010-08-26 14:41:53 -0400 (Thu, 26 Aug 2010)
New Revision: 107811

Modified:
   branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/ConcurrentFailoverRequestsTestCase.java
   branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/FailedExpirationTestCase.java
   branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/JBossCacheManagerConfigurationUnitTestCase.java
   branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/SessionCountUnitTestCase.java
   branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/SessionExpirationUnitTestCase.java
   branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/StoppedManagerUnitTestCase.java
   branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/testutil/SessionTestUtil.java
   branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/web/TestConfigurationAdder.java
Log:
stop the javac errors

Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/ConcurrentFailoverRequestsTestCase.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/ConcurrentFailoverRequestsTestCase.java	2010-08-26 18:39:10 UTC (rev 107810)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/ConcurrentFailoverRequestsTestCase.java	2010-08-26 18:41:53 UTC (rev 107811)
@@ -121,11 +121,11 @@
       
       JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(100);
       String warName = "test" + testCount;
-      JBossCacheManager jbcm0 = SessionTestUtil.createManager(warName, 30, false, null, false, false, null, dcmFactories);
+      JBossCacheManager jbcm0 = SessionTestUtil.createManager(warName, 30, false, null, false, false, null);
       jbcm0.init(warName, webMetaData);      
       jbcm0.start();
       
-      JBossCacheManager jbcm1 = SessionTestUtil.createManager(warName, 30, false, null, false, false, null, dcmFactories);
+      JBossCacheManager jbcm1 = SessionTestUtil.createManager(warName, 30, false, null, false, false, null);
       jbcm1.init(warName, webMetaData);      
       jbcm1.start();
       

Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/FailedExpirationTestCase.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/FailedExpirationTestCase.java	2010-08-26 18:39:10 UTC (rev 107810)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/FailedExpirationTestCase.java	2010-08-26 18:41:53 UTC (rev 107811)
@@ -123,7 +123,7 @@
       JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(10, true, 1, -1);
       webMetaData.getReplicationConfig().setMaxUnreplicatedInterval(0);
       String warName = "test" + testCount;
-      JBossCacheManager jbcm = SessionTestUtil.createManager(warName, 2, true, null, false, false, null, dcmFactories);
+      JBossCacheManager jbcm = SessionTestUtil.createManager(warName, 2, true, null, false, false, null);
       jbcm.init(warName, webMetaData);      
       jbcm.start();
       
@@ -160,7 +160,7 @@
       JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(10, true, 1, -1);
       webMetaData.getReplicationConfig().setMaxUnreplicatedInterval(0);
       String warName = "test" + testCount;
-      JBossCacheManager jbcm = SessionTestUtil.createManager(warName, 2, true, null, false, false, null, dcmFactories);
+      JBossCacheManager jbcm = SessionTestUtil.createManager(warName, 2, true, null, false, false, null);
       jbcm.init(warName, webMetaData);      
       jbcm.start();
       
@@ -193,7 +193,7 @@
       JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(10, true, 1, -1);
       webMetaData.getReplicationConfig().setMaxUnreplicatedInterval(0);
       String warName = "test" + testCount;
-      JBossCacheManager jbcm = SessionTestUtil.createManager(warName, 2, true, passivationDir, false, false, null, dcmFactories);
+      JBossCacheManager jbcm = SessionTestUtil.createManager(warName, 2, true, passivationDir, false, false, null);
       jbcm.init(warName, webMetaData);      
       jbcm.start();
       

Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/JBossCacheManagerConfigurationUnitTestCase.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/JBossCacheManagerConfigurationUnitTestCase.java	2010-08-26 18:39:10 UTC (rev 107810)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/JBossCacheManagerConfigurationUnitTestCase.java	2010-08-26 18:41:53 UTC (rev 107811)
@@ -37,6 +37,7 @@
 import org.jboss.metadata.web.jboss.SnapshotMode;
 import org.jboss.test.cluster.testutil.SessionTestUtil;
 import org.jboss.web.tomcat.service.session.JBossCacheManager;
+import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManagerFactory;
 import org.jboss.web.tomcat.service.session.distributedcache.spi.TestDistributedCacheManagerFactory;
 
 /**
@@ -95,7 +96,7 @@
       log.info("Enter testUseJK");
       
       ++testCount;
-      TestDistributedCacheManagerFactory factory = SessionTestUtil.createTestDistributedCacheManagerFactory(true, null, false, false, false, dcmFactories);
+      DistributedCacheManagerFactory factory = SessionTestUtil.createDistributedCacheManagerFactory(true, null, false, false, false);
       JBossCacheManager jbcm = SessionTestUtil.createManager("test" + testCount, 5, factory, null);
       JBossWebMetaData webMetaData = createWebMetaData(null, null, null, null, null);
       jbcm.init("test.war", webMetaData);      
@@ -105,7 +106,7 @@
       
       cleanupManager(jbcm, factory);
       
-      factory = SessionTestUtil.createTestDistributedCacheManagerFactory(true, null, false, false, false, dcmFactories);
+      factory = SessionTestUtil.createDistributedCacheManagerFactory(true, null, false, false, false);
       jbcm = SessionTestUtil.createManager("test" + ++testCount, 5, factory, null);
       
       webMetaData = createWebMetaData(null, null, null, null, Boolean.TRUE);
@@ -116,7 +117,7 @@
       
       cleanupManager(jbcm, factory);
       
-      factory = SessionTestUtil.createTestDistributedCacheManagerFactory(true, null, false, false, false, dcmFactories);
+      factory = SessionTestUtil.createDistributedCacheManagerFactory(true, null, false, false, false);
       jbcm = SessionTestUtil.createManager("test" + ++testCount, 5, factory, "test");
       
       webMetaData = createWebMetaData(null, null, null, null, null);
@@ -127,7 +128,7 @@
       
       cleanupManager(jbcm, factory);
       
-      factory = SessionTestUtil.createTestDistributedCacheManagerFactory(true, null, false, false, false, dcmFactories);
+      factory = SessionTestUtil.createDistributedCacheManagerFactory(true, null, false, false, false);
       jbcm = SessionTestUtil.createManager("test" + ++testCount, 5, factory, "test");
       
       webMetaData = createWebMetaData(null, null, null, null, Boolean.FALSE);
@@ -145,7 +146,7 @@
       
       ++testCount;
       
-      TestDistributedCacheManagerFactory factory = SessionTestUtil.createTestDistributedCacheManagerFactory(true, null, false, false, false, dcmFactories);
+      DistributedCacheManagerFactory factory = SessionTestUtil.createDistributedCacheManagerFactory(true, null, false, false, false);
       JBossCacheManager jbcm = SessionTestUtil.createManager("test" + testCount, 5, factory, null);
       
       JBossWebMetaData webMetaData = createWebMetaData(null, null, null, null, null);
@@ -156,7 +157,7 @@
       
       cleanupManager(jbcm, factory);
       
-      factory = SessionTestUtil.createTestDistributedCacheManagerFactory(true, null, false, false, false, dcmFactories);
+      factory = SessionTestUtil.createDistributedCacheManagerFactory(true, null, false, false, false);
       jbcm = SessionTestUtil.createManager("test" + ++testCount, 5, factory, null);
       
       webMetaData = createWebMetaData(null, null, null, null, Boolean.TRUE);
@@ -172,10 +173,9 @@
       
    }
    
-   private void cleanupManager(JBossCacheManager mgr, TestDistributedCacheManagerFactory factory) throws Exception
+   private void cleanupManager(JBossCacheManager mgr, DistributedCacheManagerFactory factory) throws Exception
    {
       mgr.stop();
-      factory.cleanup(false);
       dcmFactories.remove(factory);
    }
    

Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/SessionCountUnitTestCase.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/SessionCountUnitTestCase.java	2010-08-26 18:39:10 UTC (rev 107810)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/SessionCountUnitTestCase.java	2010-08-26 18:41:53 UTC (rev 107811)
@@ -35,6 +35,7 @@
 import org.jboss.test.cluster.testutil.JGroupsSystemPropertySupport;
 import org.jboss.test.cluster.testutil.SessionTestUtil;
 import org.jboss.web.tomcat.service.session.JBossCacheManager;
+import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManagerFactory;
 import org.jboss.web.tomcat.service.session.distributedcache.spi.TestDistributedCacheManagerFactory;
 
 /**
@@ -126,7 +127,7 @@
       
       ++testCount;
       
-      JBossCacheManager jbcm = SessionTestUtil.createManager("test" + testCount, 5, true, null, false, false, null, dcmFactories);
+      JBossCacheManager jbcm = SessionTestUtil.createManager("test" + testCount, 5, true, null, false, false, null);
        
       JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(2);
       jbcm.init("test.war", webMetaData);
@@ -169,7 +170,7 @@
       
       ++testCount;
       String passDir = getPassivationDir(testCount, 1);
-      JBossCacheManager jbcm = SessionTestUtil.createManager("test" + testCount, 5, true, passDir, false, false, null, dcmFactories);
+      JBossCacheManager jbcm = SessionTestUtil.createManager("test" + testCount, 5, true, passDir, false, false, null);
        
       JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(1, true, 1, -1);
       jbcm.init("test.war", webMetaData);
@@ -223,7 +224,7 @@
       
       ++testCount;
       String passDir = getPassivationDir(testCount, 1);
-      JBossCacheManager jbcm = SessionTestUtil.createManager("test" + testCount, 5, true, passDir, false, false, null, dcmFactories);
+      JBossCacheManager jbcm = SessionTestUtil.createManager("test" + testCount, 5, true, passDir, false, false, null);
       
       JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(1, true, 3, 1);
       jbcm.init("test.war", webMetaData);
@@ -275,7 +276,7 @@
       log.info("Enter testReplicatedMaxSessions");
       
       ++testCount;
-      JBossCacheManager jbcm0 = SessionTestUtil.createManager("test" + testCount, 1, false, null, false, false, null, dcmFactories);
+      JBossCacheManager jbcm0 = SessionTestUtil.createManager("test" + testCount, 1, false, null, false, false, null);
       
       JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(1);
       jbcm0.init("test.war", webMetaData);
@@ -286,7 +287,7 @@
       assertEquals("Correct max active count", 1, jbcm0.getMaxActiveAllowed());
       assertEquals("Correct max inactive interval", 1, jbcm0.getMaxInactiveInterval());
       
-      JBossCacheManager jbcm1 = SessionTestUtil.createManager("test" + testCount, 1, false, null, false, false, null, dcmFactories);
+      JBossCacheManager jbcm1 = SessionTestUtil.createManager("test" + testCount, 1, false, null, false, false, null);
       
       jbcm1.init("test.war", webMetaData);
       
@@ -331,7 +332,7 @@
       
       ++testCount;
       String passDir = getPassivationDir(testCount, 1);
-      JBossCacheManager jbcm0 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, false, false, null, dcmFactories);
+      JBossCacheManager jbcm0 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, false, false, null);
       
       JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(1, true, 1, -1);
       jbcm0.init("test.war", webMetaData);
@@ -344,7 +345,7 @@
       assertEquals("Correct min idle time", -1, jbcm0.getPassivationMinIdleTime());
       
       passDir = getPassivationDir(testCount, 2);
-      JBossCacheManager jbcm1 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, false, false, null, dcmFactories);
+      JBossCacheManager jbcm1 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, false, false, null);
       
       jbcm1.init("test.war", webMetaData);
       
@@ -394,7 +395,7 @@
       
       ++testCount;
       String passDir = getPassivationDir(testCount, 1);
-      JBossCacheManager jbcm0 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, false, false, null, dcmFactories);
+      JBossCacheManager jbcm0 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, false, false, null);
       
       JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(1, true, 3, 1);
       jbcm0.init("test.war", webMetaData);
@@ -407,7 +408,7 @@
       assertEquals("Correct min idle time", 1, jbcm0.getPassivationMinIdleTime());
       
       passDir = getPassivationDir(testCount, 2);
-      JBossCacheManager jbcm1 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, false, false, null, dcmFactories);
+      JBossCacheManager jbcm1 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, false, false, null);
       
       jbcm1.init("test.war", webMetaData);
       
@@ -458,7 +459,7 @@
       
       ++testCount;
       String passDir = getPassivationDir(testCount, 1);
-      JBossCacheManager jbcm0 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, true, false, null, dcmFactories);
+      JBossCacheManager jbcm0 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, true, false, null);
       
       JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(1, true, 3, 1);
       jbcm0.init("test.war", webMetaData);
@@ -471,7 +472,7 @@
       assertEquals("Correct min idle time", 1, jbcm0.getPassivationMinIdleTime());
       
       passDir = getPassivationDir(testCount, 2);
-      JBossCacheManager jbcm1 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, true, false, null, dcmFactories);
+      JBossCacheManager jbcm1 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, true, false, null);
       
       jbcm1.init("test.war", webMetaData);
       
@@ -518,7 +519,7 @@
       
       ++testCount;
       String passDir = getPassivationDir(testCount, 1);
-      JBossCacheManager jbcm0 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, false, true, null, dcmFactories);
+      JBossCacheManager jbcm0 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, false, true, null);
       
       JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(1, true, 3, 1);
       jbcm0.init("test.war", webMetaData);
@@ -531,7 +532,7 @@
       assertEquals("Correct min idle time", 1, jbcm0.getPassivationMinIdleTime());
       
       passDir = getPassivationDir(testCount, 2);
-      JBossCacheManager jbcm1 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, false, true, null, dcmFactories);
+      JBossCacheManager jbcm1 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, false, true, null);
       
       jbcm1.init("test.war", webMetaData);
       
@@ -578,7 +579,7 @@
       
       ++testCount;
       String passDir = getPassivationDir(testCount, 1);
-      JBossCacheManager jbcm0 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, true, true, null, dcmFactories);
+      JBossCacheManager jbcm0 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, true, true, null);
       
       JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(1, true, 3, 1);
       jbcm0.init("test.war", webMetaData);
@@ -591,7 +592,7 @@
       assertEquals("Correct min idle time", 1, jbcm0.getPassivationMinIdleTime());
       
       passDir = getPassivationDir(testCount, 2);
-      JBossCacheManager jbcm1 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, true, true, null, dcmFactories);
+      JBossCacheManager jbcm1 = SessionTestUtil.createManager("test" + testCount, 1, false, passDir, true, true, null);
       
       jbcm1.init("test.war", webMetaData);
       
@@ -651,7 +652,7 @@
    {
       ++testCount;
       String passDir = getPassivationDir(testCount, 1);
-      TestDistributedCacheManagerFactory factory = SessionTestUtil.createTestDistributedCacheManagerFactory(true, passDir, false, false, false, dcmFactories);
+      DistributedCacheManagerFactory factory = SessionTestUtil.createDistributedCacheManagerFactory(true, passDir, false, false, false);
       JBossCacheManager jbcm = SessionTestUtil.createManager("test" + testCount, 300, factory, null);
       
       JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(2, true, 3, 1);
@@ -695,11 +696,10 @@
       
       if (restartCache)
       {
-         factory.cleanup(false);
          dcmFactories.remove(factory);
          
          passDir = getPassivationDir(testCount, 1);
-         jbcm = SessionTestUtil.createManager("test" + testCount, 5, true, passDir, false, false, null, dcmFactories);
+         jbcm = SessionTestUtil.createManager("test" + testCount, 5, true, passDir, false, false, null);
       }
       else
       {
@@ -765,7 +765,7 @@
    {
       ++testCount;
       String passDir = getPassivationDir(testCount, 1);
-      TestDistributedCacheManagerFactory factory = SessionTestUtil.createTestDistributedCacheManagerFactory(false, passDir, totalReplication, marshalling, purgeOnStartStop, dcmFactories);
+       DistributedCacheManagerFactory factory = SessionTestUtil.createDistributedCacheManagerFactory(false, passDir, totalReplication, marshalling, purgeOnStartStop);
       JBossCacheManager jbcm = SessionTestUtil.createManager("test" + testCount, 300, factory, null);
       
       JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(2, true, 30, 1);
@@ -779,14 +779,14 @@
       assertEquals("Correct min idle time", 1, jbcm.getPassivationMinIdleTime());
       
       passDir = getPassivationDir(testCount, 2);
-      TestDistributedCacheManagerFactory factory1 = SessionTestUtil.createTestDistributedCacheManagerFactory(false, passDir, totalReplication, marshalling, purgeOnStartStop, dcmFactories);
+      DistributedCacheManagerFactory factory1 = SessionTestUtil.createDistributedCacheManagerFactory(false, passDir, totalReplication, marshalling, purgeOnStartStop);
       JBossCacheManager jbcm1 = SessionTestUtil.createManager("test" + testCount, 300, factory1, null);
       
       jbcm1.init("test.war", webMetaData);
       
       jbcm1.start();
       
-      SessionTestUtil.blockUntilViewsReceived(new TestDistributedCacheManagerFactory[]{ factory, factory1 }, 10000);
+      SessionTestUtil.blockUntilViewsReceived(new JBossCacheManager[]{ jbcm, jbcm1 }, 10000);
       
       assertTrue("Passivation is enabled", jbcm1.isPassivationEnabled());
       assertEquals("Correct max active count", 2, jbcm1.getMaxActiveAllowed());
@@ -837,7 +837,6 @@
       if (fullRestart)
       {
         jbcm1.stop();
-        factory1.cleanup(false);
         dcmFactories.remove(factory1);
       }
       
@@ -845,11 +844,10 @@
       
       if (restartCache)
       {
-         factory.cleanup(false);
          dcmFactories.remove(factory);
          
          passDir = getPassivationDir(testCount, 1);
-         factory = SessionTestUtil.createTestDistributedCacheManagerFactory(false, passDir, totalReplication, marshalling, purgeOnStartStop, dcmFactories);
+         factory = SessionTestUtil.createDistributedCacheManagerFactory(false, passDir, totalReplication, marshalling, purgeOnStartStop);
          jbcm = SessionTestUtil.createManager("test" + testCount, 300, factory, null);
       }
       else

Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/SessionExpirationUnitTestCase.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/SessionExpirationUnitTestCase.java	2010-08-26 18:39:10 UTC (rev 107810)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/SessionExpirationUnitTestCase.java	2010-08-26 18:41:53 UTC (rev 107811)
@@ -113,14 +113,14 @@
       
       ++testCount;
       
-      JBossCacheManager jbcm0= SessionTestUtil.createManager("test" + testCount, 5, false, null, true, true, null, dcmFactories);
+      JBossCacheManager jbcm0= SessionTestUtil.createManager("test" + testCount, 5, false, null, true, true, null);
        
       JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(2);
       jbcm0.init("test.war", webMetaData);
       
       jbcm0.start();
       
-      JBossCacheManager jbcm1 = SessionTestUtil.createManager("test" + testCount, 5, false, null, true, true, null, dcmFactories);
+      JBossCacheManager jbcm1 = SessionTestUtil.createManager("test" + testCount, 5, false, null, true, true, null);
       
       jbcm1.init("test.war", webMetaData);
       

Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/StoppedManagerUnitTestCase.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/StoppedManagerUnitTestCase.java	2010-08-26 18:39:10 UTC (rev 107810)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/StoppedManagerUnitTestCase.java	2010-08-26 18:41:53 UTC (rev 107811)
@@ -94,7 +94,7 @@
       
       ++testCount;
       
-      JBossCacheManager jbcm = SessionTestUtil.createManager("test" + testCount, 30, true, null, false, false, null, dcmFactories);
+      JBossCacheManager jbcm = SessionTestUtil.createManager("test" + testCount, 30, true, null, false, false, null);
        
       JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(100);
       jbcm.init("test.war", webMetaData);

Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/testutil/SessionTestUtil.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/testutil/SessionTestUtil.java	2010-08-26 18:39:10 UTC (rev 107810)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/testutil/SessionTestUtil.java	2010-08-26 18:41:53 UTC (rev 107811)
@@ -55,8 +55,10 @@
 import org.infinispan.loaders.file.FileCacheStoreConfig;
 import org.infinispan.manager.CacheContainer;
 import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.remoting.transport.Address;
 import org.infinispan.transaction.tm.BatchModeTransactionManager;
 import org.infinispan.util.concurrent.IsolationLevel;
+import org.jboss.ha.ispn.DefaultCacheContainerRegistry;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.javaee.spec.EmptyMetaData;
 import org.jboss.metadata.web.jboss.JBossWebMetaData;
@@ -130,7 +132,7 @@
       // the container's setting will override ours
       // Can't just set the container as their config is per minute not per second
       jbcm.setMaxInactiveInterval(maxInactiveInterval);
-   
+
       return jbcm;      
    }
    
@@ -174,7 +176,7 @@
       }
       
       final CacheContainer container = new DefaultCacheManager(globalConfig, config);
-      
+
       CacheSource source = new CacheSource()
       {
          @Override
@@ -187,7 +189,7 @@
       org.jboss.web.tomcat.service.session.distributedcache.ispn.DistributedCacheManagerFactory factory = new org.jboss.web.tomcat.service.session.distributedcache.ispn.DistributedCacheManagerFactory();
 
       factory.setCacheSource(source);
-      
+
       return factory;
    }
 
@@ -391,7 +393,32 @@
       return contextPath + "_" + hostname;
    }
 
+   /**
+    * Loops, continually calling {@link #areCacheViewsComplete(JBossCacheManager[])}
+    * until it either returns true or <code>timeout</code> ms have elapsed.
+    *
+    * @param cacheManager  caches which must all have consistent views
+    * @param timeout max number of ms to loop
+    * @throws RuntimeException if <code>timeout</code> ms have elapse without
+    *                          all caches having the same number of members.
+    */
+   public static void blockUntilViewsReceived(JBossCacheManager[] cacheManager, long timeout)
+   {
+      long failTime = System.currentTimeMillis() + timeout;
 
+      while (System.currentTimeMillis() < failTime)
+      {
+         sleepThread(100);
+         if (areCacheViewsComplete(cacheManager))
+         {
+            return;
+         }
+      }
+
+      throw new RuntimeException("timed out before caches had complete views");
+   }
+
+
    /**
     * Loops, continually calling {@link #areCacheViewsComplete(TestDistributedCacheManagerFactory[])}
     * until it either returns true or <code>timeout</code> ms have elapsed.
@@ -417,8 +444,37 @@
       throw new RuntimeException("timed out before caches had complete views");
    }
 
+
+
    /**
     * Checks each cache to see if the number of elements in the array
+    * returned by {@link EmbeddedCacheManager#getMembers()} matches the size of
+    * the <code>dcmFactories</code> parameter.
+    *
+    * @param cacheManager factory whose caches should form a View
+    * @return <code>true</code> if all caches have
+    *         <code>factories.length</code> members; false otherwise
+    * @throws IllegalStateException if any of the caches have MORE view
+    *                               members than factories.length
+    */
+   public static boolean areCacheViewsComplete(JBossCacheManager[] cacheManager)
+   {
+      int memberCount = cacheManager.length;
+
+      for (int i = 0; i < memberCount; i++)
+      {
+         if (!isCacheViewComplete( memberCount, true))
+         {
+            return false;
+         }
+      }
+
+      return true;
+
+   }
+
+   /**
+    * Checks each cache to see if the number of elements in the array
     * returned by {@link TestDistributedCacheFactory#getMembers()} matches the size of
     * the <code>dcmFactories</code> parameter.
     *
@@ -447,7 +503,42 @@
 
       return true;
    }
-   
+
+   public static boolean isCacheViewComplete(int memberCount, boolean barfIfTooManyMembers)
+   {
+      List<Address> members = DefaultCacheContainerRegistry.getInstance().getCacheContainer("web-session").getMembers();
+      if (members == null || memberCount > members.size())
+      {
+         return false;
+      }
+      else if (memberCount < members.size())
+      {
+         if (barfIfTooManyMembers)
+         {
+            // This is an exceptional condition
+            StringBuffer sb = new StringBuffer("Cache had ");
+            sb.append(members.size());
+            sb.append(" members; expecting ");
+            sb.append(memberCount);
+            sb.append(". Members were (");
+            for (int j = 0; j < members.size(); j++)
+            {
+               if (j > 0)
+               {
+                  sb.append(", ");
+               }
+               sb.append(members.get(j));
+            }
+            sb.append(')');
+
+            throw new IllegalStateException(sb.toString());
+         }
+         else return false;
+      }
+
+      return true;
+   }
+
    public static boolean isCacheViewComplete(TestDistributedCacheManagerFactory factory, int memberCount, boolean barfIfTooManyMembers)
    {
       List<Object> members = factory.getMembers();

Modified: branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/web/TestConfigurationAdder.java
===================================================================
--- branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/web/TestConfigurationAdder.java	2010-08-26 18:39:10 UTC (rev 107810)
+++ branches/infinispan-int/testsuite/src/main/org/jboss/test/cluster/web/TestConfigurationAdder.java	2010-08-26 18:41:53 UTC (rev 107811)
@@ -24,9 +24,6 @@
 
 import java.util.Map;
 
-import org.jboss.cache.config.Configuration;
-import org.jboss.cache.config.ConfigurationRegistry;
-import org.jboss.cache.config.Configuration.CacheMode;
 
 /**
  * Utility that analyzes the set of available cache configurations in
@@ -39,7 +36,7 @@
 {
    public static final String DEFAULT_STD_SESSION_CFG = "standard-session-cache";
    
-   private ConfigurationRegistry configurationRegistry;
+//   private ConfigurationRegistry configurationRegistry;
    private Map<String, String> configurationAliases;
    private String standardSessionConfig = DEFAULT_STD_SESSION_CFG;
    private boolean addAlternateCacheMode;
@@ -47,89 +44,89 @@
    
    public void start() throws Exception
    {
-      String alias = configurationAliases == null ? null : configurationAliases.get(standardSessionConfig);
-      createAlternates(standardSessionConfig, configurationRegistry.getConfiguration(alias == null ? standardSessionConfig : alias));
+//      String alias = configurationAliases == null ? null : configurationAliases.get(standardSessionConfig);
+//      createAlternates(standardSessionConfig, configurationRegistry.getConfiguration(alias == null ? standardSessionConfig : alias));
    }
 
-   private void createAlternates(String stdName, Configuration std) throws Exception
-   {
-      CacheMode altCacheMode = (std.getCacheMode() == CacheMode.REPL_ASYNC) ? CacheMode.REPL_SYNC : CacheMode.REPL_ASYNC;
-      String altCacheModeTag = (altCacheMode == CacheMode.REPL_ASYNC ? "async" : "sync");
-      boolean brEnabled = !std.getBuddyReplicationConfig().isEnabled();
-      String altBrTag = (brEnabled ? "br-enabled" : "br-disabled");
-      
-      String altModeName = altCacheModeTag + "-" + stdName;
-      if (configurationRegistry.getConfigurationNames().contains(altModeName) == false)
-      {
-         Configuration altMode = std.clone();
-         altMode.setCacheMode(altCacheMode);
-         altMode.setClusterName(altModeName);
-         configurationRegistry.registerConfiguration(altModeName, altMode);
-      }
-      
-      String altBrName = altBrTag + "-" + stdName;
-      if (configurationRegistry.getConfigurationNames().contains(altBrName) == false)
-      {
-         Configuration altBr = std.clone();
-         altBr.getBuddyReplicationConfig().setEnabled(brEnabled);
-         altBr.setClusterName(altBrName);
-         configurationRegistry.registerConfiguration(altBrName, altBr);
-      }
-      
-      String altCombinedName = altBrTag + "-" + altCacheModeTag + "-" + stdName;
-      if (configurationRegistry.getConfigurationNames().contains(altCombinedName) == false)
-      {
-         Configuration altCombined = std.clone();
-         altCombined.setCacheMode(altCacheMode);
-         altCombined.getBuddyReplicationConfig().setEnabled(brEnabled);
-         altCombined.setClusterName(altCombinedName);
-         configurationRegistry.registerConfiguration(altCombinedName, altCombined);
-      }
-   }
+//   private void createAlternates(String stdName, Configuration std) throws Exception
+//   {
+//      CacheMode altCacheMode = (std.getCacheMode() == CacheMode.REPL_ASYNC) ? CacheMode.REPL_SYNC : CacheMode.REPL_ASYNC;
+//      String altCacheModeTag = (altCacheMode == CacheMode.REPL_ASYNC ? "async" : "sync");
+//      boolean brEnabled = !std.getBuddyReplicationConfig().isEnabled();
+//      String altBrTag = (brEnabled ? "br-enabled" : "br-disabled");
+//
+//      String altModeName = altCacheModeTag + "-" + stdName;
+//      if (configurationRegistry.getConfigurationNames().contains(altModeName) == false)
+//      {
+//         Configuration altMode = std.clone();
+//         altMode.setCacheMode(altCacheMode);
+//         altMode.setClusterName(altModeName);
+//         configurationRegistry.registerConfiguration(altModeName, altMode);
+//      }
+//
+//      String altBrName = altBrTag + "-" + stdName;
+//      if (configurationRegistry.getConfigurationNames().contains(altBrName) == false)
+//      {
+//         Configuration altBr = std.clone();
+//         altBr.getBuddyReplicationConfig().setEnabled(brEnabled);
+//         altBr.setClusterName(altBrName);
+//         configurationRegistry.registerConfiguration(altBrName, altBr);
+//      }
+//
+//      String altCombinedName = altBrTag + "-" + altCacheModeTag + "-" + stdName;
+//      if (configurationRegistry.getConfigurationNames().contains(altCombinedName) == false)
+//      {
+//         Configuration altCombined = std.clone();
+//         altCombined.setCacheMode(altCacheMode);
+//         altCombined.getBuddyReplicationConfig().setEnabled(brEnabled);
+//         altCombined.setClusterName(altCombinedName);
+//         configurationRegistry.registerConfiguration(altCombinedName, altCombined);
+//      }
+//   }
 
 
-   public ConfigurationRegistry getConfigurationRegistry()
-   {
-      return configurationRegistry;
-   }
-   public void setConfigurationRegistry(ConfigurationRegistry configurationRegistry)
-   {
-      this.configurationRegistry = configurationRegistry;
-   }   
-   public Map<String, String> getConfigurationAliases()
-   {
-      return configurationAliases;
-   }
-   public void setConfigurationAliases(Map<String, String> configurationAliases)
-   {
-      this.configurationAliases = configurationAliases;
-   }
-
-   public String getStandardSessionConfig()
-   {
-      return standardSessionConfig;
-   }
-   public void setStandardSessionConfig(String standardSessionConfig)
-   {
-      this.standardSessionConfig = standardSessionConfig;
-   }
-   public boolean isAddAlternateCacheMode()
-   {
-      return addAlternateCacheMode;
-   }
-   public void setAddAlternateCacheMode(boolean addAlternateCacheMode)
-   {
-      this.addAlternateCacheMode = addAlternateCacheMode;
-   }
-   public boolean isAddAlternateBuddyReplication()
-   {
-      return addAlternateBuddyReplication;
-   }
-   public void setAddAlternateBuddyReplication(boolean addAlternateBuddyReplication)
-   {
-      this.addAlternateBuddyReplication = addAlternateBuddyReplication;
-   }
+//   public ConfigurationRegistry getConfigurationRegistry()
+//   {
+//      return configurationRegistry;
+//   }
+//   public void setConfigurationRegistry(ConfigurationRegistry configurationRegistry)
+//   {
+//      this.configurationRegistry = configurationRegistry;
+//   }
+//   public Map<String, String> getConfigurationAliases()
+//   {
+//      return configurationAliases;
+//   }
+//   public void setConfigurationAliases(Map<String, String> configurationAliases)
+//   {
+//      this.configurationAliases = configurationAliases;
+//   }
+//
+//   public String getStandardSessionConfig()
+//   {
+//      return standardSessionConfig;
+//   }
+//   public void setStandardSessionConfig(String standardSessionConfig)
+//   {
+//      this.standardSessionConfig = standardSessionConfig;
+//   }
+//   public boolean isAddAlternateCacheMode()
+//   {
+//      return addAlternateCacheMode;
+//   }
+//   public void setAddAlternateCacheMode(boolean addAlternateCacheMode)
+//   {
+//      this.addAlternateCacheMode = addAlternateCacheMode;
+//   }
+//   public boolean isAddAlternateBuddyReplication()
+//   {
+//      return addAlternateBuddyReplication;
+//   }
+//   public void setAddAlternateBuddyReplication(boolean addAlternateBuddyReplication)
+//   {
+//      this.addAlternateBuddyReplication = addAlternateBuddyReplication;
+//   }
+//
    
-   
 
 }



More information about the jboss-cvs-commits mailing list