1 7 package org.jboss.cache.tests; 8 9 import junit.framework.Test; 10 import junit.framework.TestSuite; 11 12 import java.io.File ; 13 import java.io.FileFilter ; 14 import java.util.Properties ; 15 16 21 public class BdbjeCacheLoaderTest extends CacheLoaderTestsBase { 22 23 24 protected void configureCache() throws Exception { 25 File dir = new File ("."); 26 27 class MyFilter implements FileFilter { 28 public boolean accept(File file) { 29 return file.getName().endsWith(".jdb"); 30 } 31 } 32 33 File [] files=dir.listFiles(new MyFilter()); 34 if (files != null) { 35 for (int i = 0; i < files.length; i += 1) { 36 File file = files[i]; 37 if (file.isFile()) { 38 if (!file.delete()) { 39 System.err.println("Unable to delete: " + file); 40 } 41 } 42 } 43 } 44 45 cache.setCacheLoaderClass("org.jboss.cache.loader.bdbje.BdbjeCacheLoader"); 46 Properties props=new Properties (); 47 props.setProperty("location", ".#temp"); 48 cache.setCacheLoaderConfig(props); 49 } 50 51 52 public static Test suite() { 53 return new TestSuite(BdbjeCacheLoaderTest.class); 54 } 55 56 57 58 } 59 | Popular Tags |