1 17 18 package org.apache.geronimo.transaction.log; 19 20 import java.io.File ; 21 22 import junit.extensions.TestSetup; 23 import junit.framework.Test; 24 import junit.framework.TestSuite; 25 import org.apache.geronimo.transaction.manager.TransactionLog; 26 import org.apache.geronimo.transaction.manager.XidFactory; 27 import org.apache.geronimo.transaction.manager.XidFactoryImpl; 28 29 35 public class HOWLLogTest extends AbstractLogTest { 36 private static final File basedir = new File (System.getProperty("basedir", System.getProperty("user.dir"))); 37 private static final String LOG_FILE_NAME = "howl_test"; 38 39 40 protected String getResultFileName() { 41 return "howllog"; 42 } 43 44 protected void closeTransactionLog(TransactionLog transactionLog) throws Exception { 45 ((HOWLLog) transactionLog).doStop(); 46 } 47 48 49 protected TransactionLog createTransactionLog() throws Exception { 50 XidFactory xidFactory = new XidFactoryImpl(); 51 HOWLLog howlLog = new HOWLLog( 52 "org.objectweb.howl.log.BlockLogBuffer", 4, true, true, 20, "txlog", "log", LOG_FILE_NAME, 200, 10, 2, 2, 10, xidFactory, 66 new File (basedir, "target") 67 ); 68 howlLog.doStart(); 69 return howlLog; 70 } 71 public static Test suite() { 72 return new TestSetup(new TestSuite(HOWLLogTest.class)) { 73 protected void setUp() throws Exception { 74 File logFile = new File (basedir, "target/" + LOG_FILE_NAME + "_1.log"); 75 if (logFile.exists()) { 76 logFile.delete(); 77 } 78 logFile = new File (basedir, "target/" + LOG_FILE_NAME + "_2.log"); 79 if (logFile.exists()) { 80 logFile.delete(); 81 } 82 } 83 }; 84 } 85 86 } 87 | Popular Tags |