[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/passivation ...
Manik Surtani
msurtani at jboss.com
Wed Dec 20 08:34:28 EST 2006
User: msurtani
Date: 06/12/20 08:34:28
Modified: tests/functional/org/jboss/cache/passivation
ConcurrentPassivationTest.java
BasicPassivationTest.java
LocalPassivationIntegrationTest.java
Log:
Added sufficient clean ups to unit tests
Revision Changes Path
1.6 +4 -29 JBossCache/tests/functional/org/jboss/cache/passivation/ConcurrentPassivationTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ConcurrentPassivationTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/passivation/ConcurrentPassivationTest.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- ConcurrentPassivationTest.java 14 Nov 2006 14:17:11 -0000 1.5
+++ ConcurrentPassivationTest.java 20 Dec 2006 13:34:28 -0000 1.6
@@ -13,14 +13,13 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.TreeCache;
import org.jboss.cache.factories.XmlConfigurationParser;
-
-import java.io.File;
+import org.jboss.cache.misc.TestingUtil;
/**
* Tests cache behavior in the presence of concurrent passivation.
*
* @author Brian Stansberry
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public class ConcurrentPassivationTest extends TestCase
{
@@ -44,7 +43,7 @@
void initCaches() throws Exception
{
- removeStaleFiles();
+ TestingUtil.recursiveFileRemove("/tmp/JBossCacheFileCacheLoader");
cache_ = new TreeCache();
cache_.setConfiguration(new XmlConfigurationParser().parseFile("META-INF/local-passivation-service.xml")); // read in generic local xml
cache_.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
@@ -54,35 +53,11 @@
public void tearDown() throws Exception
{
super.tearDown();
- removeStaleFiles();
+ TestingUtil.recursiveFileRemove("/tmp/JBossCacheFileCacheLoader");
cache_.stop();
cache_ = null;
}
- private void removeStaleFiles()
- {
- File file = new File("/tmp/JBossCacheFileCacheLoader");
- if (file.exists())
- {
- System.out.println("Deleting file " + file);
- recursivedelete(file);
- }
- }
-
- private void recursivedelete(File f)
- {
- if (f.isDirectory())
- {
- File[] files = f.listFiles();
- for (int i = 0; i < files.length; i++)
- {
- recursivedelete(files[i]);
- }
- }
- //System.out.println("File " + f.toURI() + " deleted = " + f.delete());
- f.delete();
- }
-
public void testConcurrentPassivation() throws Exception
{
Fqn base = Fqn.fromString("/org/jboss/test/data/concurrent/passivation");
1.12 +5 -4 JBossCache/tests/functional/org/jboss/cache/passivation/BasicPassivationTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BasicPassivationTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/passivation/BasicPassivationTest.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- BasicPassivationTest.java 14 Nov 2006 14:17:11 -0000 1.11
+++ BasicPassivationTest.java 20 Dec 2006 13:34:28 -0000 1.12
@@ -19,7 +19,7 @@
/**
* @author Ben Wang
- * @version $Revision: 1.11 $
+ * @version $Revision: 1.12 $
*/
public class BasicPassivationTest extends TestCase
{
@@ -41,6 +41,7 @@
public void setUp() throws Exception
{
super.setUp();
+ TestingUtil.recursiveFileRemove("/tmp/JBossCacheFileCacheLoader"); // clean up any stale files left around by previous unit tests
initCaches();
wakeupIntervalMillis_ = cache_.getConfiguration().getEvictionConfig().getWakeupIntervalSeconds() * 1000;
log("wakeupInterval is " + wakeupIntervalMillis_);
1.11 +2 -1 JBossCache/tests/functional/org/jboss/cache/passivation/LocalPassivationIntegrationTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LocalPassivationIntegrationTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/passivation/LocalPassivationIntegrationTest.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- LocalPassivationIntegrationTest.java 14 Nov 2006 14:17:11 -0000 1.10
+++ LocalPassivationIntegrationTest.java 20 Dec 2006 13:34:28 -0000 1.11
@@ -37,6 +37,7 @@
public void setUp() throws Exception
{
super.setUp();
+ TestingUtil.recursiveFileRemove("/tmp/JBossCacheFileCacheLoader"); // clean up any stale files left around by previous unit tests
cache_ = new TreeCache();
initCaches(cache_);
cache_.getConfiguration().setUseRegionBasedMarshalling(true);
@@ -118,7 +119,7 @@
{
if (pre)
{
- System.out.println("nodePassivate(): " +fqn);
+ System.out.println("nodePassivate(): " + fqn);
}
}
More information about the jboss-cvs-commits
mailing list