[jboss-cvs] JBossAS SVN: r69213 - in trunk/testsuite/src/main/org/jboss/test/cluster: testutil and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jan 22 15:40:39 EST 2008


Author: bstansberry at jboss.com
Date: 2008-01-22 15:40:38 -0500 (Tue, 22 Jan 2008)
New Revision: 69213

Modified:
   trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/JBossCacheManagerConfigurationUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/cluster/testutil/SessionTestUtil.java
Log:
Ensure caches get cleaned up if they are instantiated

Modified: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/JBossCacheManagerConfigurationUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/JBossCacheManagerConfigurationUnitTestCase.java	2008-01-22 20:39:20 UTC (rev 69212)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/JBossCacheManagerConfigurationUnitTestCase.java	2008-01-22 20:40:38 UTC (rev 69213)
@@ -112,8 +112,8 @@
    {
       log.info("Enter testUseJK");
       
-      JBossCacheManager jbcm = SessionTestUtil.createManager("test" + ++testCount, 5, true, null, false, false, null);
-      caches.add(jbcm.getPojoCache());
+      ++testCount;
+      JBossCacheManager jbcm = SessionTestUtil.createManager("test" + testCount, 5, true, null, false, false, null, caches);
       
       JBossWebMetaData webMetaData = createWebMetaData(null, null, null, null, null);
       jbcm.init("test.war", webMetaData);      
@@ -123,8 +123,7 @@
       
       cleanupManager(jbcm);
       
-      jbcm = SessionTestUtil.createManager("test" + ++testCount, 5, true, null, false, false, null);
-      caches.add(jbcm.getPojoCache());
+      jbcm = SessionTestUtil.createManager("test" + ++testCount, 5, true, null, false, false, null, caches);
       
       webMetaData = createWebMetaData(null, null, null, null, Boolean.TRUE);
       jbcm.init("test.war", webMetaData);      
@@ -134,8 +133,7 @@
       
       cleanupManager(jbcm);
       
-      jbcm = SessionTestUtil.createManager("test" + ++testCount, 5, true, null, false, false, "test");
-      caches.add(jbcm.getPojoCache());
+      jbcm = SessionTestUtil.createManager("test" + ++testCount, 5, true, null, false, false, "test", caches);
       
       webMetaData = createWebMetaData(null, null, null, null, null);
       jbcm.init("test.war", webMetaData);      
@@ -145,8 +143,7 @@
       
       cleanupManager(jbcm);
       
-      jbcm = SessionTestUtil.createManager("test" + ++testCount, 5, true, null, false, false, "test");
-      caches.add(jbcm.getPojoCache());
+      jbcm = SessionTestUtil.createManager("test" + ++testCount, 5, true, null, false, false, "test", caches);
       
       webMetaData = createWebMetaData(null, null, null, null, Boolean.FALSE);
       jbcm.init("test.war", webMetaData);      
@@ -156,13 +153,15 @@
       
       cleanupManager(jbcm);
       
-   }public void testSnapshot() throws Exception
+   }
+   
+   public void testSnapshot() throws Exception
    {
       log.info("Enter testSnapshot");
       
-      JBossCacheManager jbcm = SessionTestUtil.createManager("test" + ++testCount, 5, true, null, false, false, null);
-      caches.add(jbcm.getPojoCache());
-      
+      ++testCount;
+      JBossCacheManager jbcm = SessionTestUtil.createManager("test" + testCount, 5, true, null, false, false, null, caches);
+       
       JBossWebMetaData webMetaData = createWebMetaData(null, null, null, null, null);
       jbcm.init("test.war", webMetaData);      
       jbcm.start();
@@ -171,8 +170,7 @@
       
       cleanupManager(jbcm);
       
-      jbcm = SessionTestUtil.createManager("test" + ++testCount, 5, true, null, false, false, null);
-      caches.add(jbcm.getPojoCache());
+      jbcm = SessionTestUtil.createManager("test" + ++testCount, 5, true, null, false, false, null, caches);
       
       webMetaData = createWebMetaData(null, null, null, null, Boolean.TRUE);
       webMetaData.getReplicationConfig().setSnapshotMode(SnapshotMode.INTERVAL);

Modified: trunk/testsuite/src/main/org/jboss/test/cluster/testutil/SessionTestUtil.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/testutil/SessionTestUtil.java	2008-01-22 20:39:20 UTC (rev 69212)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/testutil/SessionTestUtil.java	2008-01-22 20:40:38 UTC (rev 69213)
@@ -61,9 +61,9 @@
    public static JBossCacheManager createManager(String warName, int maxInactiveInterval, 
                                                  boolean local, String passivationDir, 
                                                  boolean totalReplication, boolean marshalling, 
-                                                 String jvmRoute)
+                                                 String jvmRoute, Set<PojoCache> allCaches)
    {
-      PojoCache cache = createCache(local, passivationDir, totalReplication, marshalling, true);
+      PojoCache cache = createCache(local, passivationDir, totalReplication, marshalling, allCaches);
       return createManager(warName, maxInactiveInterval, cache, jvmRoute);
    }
    
@@ -91,10 +91,12 @@
    }
    
    public static PojoCache createCache(boolean local, String passivationDir, 
-         boolean totalReplication, boolean marshalling, boolean start)
+         boolean totalReplication, boolean marshalling, Set<PojoCache> allCaches)
    {
       Configuration cfg = getConfiguration(local, passivationDir, totalReplication, marshalling);
-      return PojoCacheFactory.createCache(cfg, start);
+      PojoCache cache = PojoCacheFactory.createCache(cfg, true);
+      allCaches.add(cache);
+      return cache;
    }
    
    public static Configuration getConfiguration(boolean local, String passivationDir, 




More information about the jboss-cvs-commits mailing list