[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/passivation ...
Manik Surtani
msurtani at jboss.com
Wed Nov 8 12:29:20 EST 2006
User: msurtani
Date: 06/11/08 12:29:20
Modified: tests/functional/org/jboss/cache/passivation
ConcurrentPassivationTest.java
Log:
fixed setup and teardown
Revision Changes Path
1.4 +17 -5 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.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- ConcurrentPassivationTest.java 31 Oct 2006 17:33:35 -0000 1.3
+++ ConcurrentPassivationTest.java 8 Nov 2006 17:29:20 -0000 1.4
@@ -13,7 +13,6 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.TreeCache;
import org.jboss.cache.factories.XmlConfigurationParser;
-import org.jboss.cache.loader.FileCacheLoaderConfig;
import java.io.File;
@@ -21,7 +20,7 @@
* Tests cache behavior in the presence of concurrent passivation.
*
* @author Brian Stansberry
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class ConcurrentPassivationTest extends TestCase
{
@@ -62,15 +61,28 @@
private void removeStaleFiles()
{
- File file = new File(cache_ == null ? "/tmp/JBossCacheFileCacheLoader" : ((FileCacheLoaderConfig) cache_.getCacheLoader().getConfig()).getLocation());
+ File file = new File("/tmp/JBossCacheFileCacheLoader");
if (file.exists())
{
System.out.println("Deleting file " + file);
- file.deleteOnExit();
- System.out.println(file.delete());
+ 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");
More information about the jboss-cvs-commits
mailing list