geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject cvs commit: incubator-geronimo/modules/transaction/src/test/org/apache/geronimo/transaction/manager AbstractRecoveryTest.java HOWLLogRecoveryTest.java
Date Tue, 22 Jun 2004 18:41:00 GMT
djencks     2004/06/22 11:41:00

  Modified:    modules/transaction project.xml
               modules/transaction/src/java/org/apache/geronimo/transaction/log
                        HOWLLog.java
               modules/transaction/src/test/org/apache/geronimo/transaction/log
                        AbstractLogTest.java HOWLLogTest.java
               modules/transaction/src/test/org/apache/geronimo/transaction/manager
                        AbstractRecoveryTest.java HOWLLogRecoveryTest.java
  Log:
  Use tagged version of HOWL.  Try again to get HOWL tests to pass
  
  Revision  Changes    Path
  1.17      +3 -3      incubator-geronimo/modules/transaction/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/transaction/project.xml,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- project.xml	20 Jun 2004 07:39:34 -0000	1.16
  +++ project.xml	22 Jun 2004 18:41:00 -0000	1.17
  @@ -76,11 +76,11 @@
               <url>http://jakarta.apache.org/commons/logging/</url>
           </dependency>
   
  -        <!--this is an experimental version compiled by David Jencks-->
  +        <!--compiled by David Jencks, but tagged version-->
           <dependency>
                <groupId>howl</groupId>
               <artifactId>howl-logger</artifactId>
  -            <version>GERONIMO-PRIVATE-0.1</version>
  +            <version>0.1.1</version>
               <url>http://forge.objectweb.org/projects/howl</url>
           </dependency>
   
  
  
  
  1.3       +4 -4      incubator-geronimo/modules/transaction/src/java/org/apache/geronimo/transaction/log/HOWLLog.java
  
  Index: HOWLLog.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/transaction/src/java/org/apache/geronimo/transaction/log/HOWLLog.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HOWLLog.java	20 Jun 2004 07:39:02 -0000	1.2
  +++ HOWLLog.java	22 Jun 2004 18:41:00 -0000	1.3
  @@ -355,7 +355,7 @@
               if (type == PREPARE) {
                   Set branches = new HashSet();
                   recoveredTx.put(masterXid, branches);
  -                log.info("recovered prepare record for master xid: " + masterXid);
  +//                log.info("recovered prepare record for master xid: " + masterXid);
                   while (raw.hasRemaining()) {
                       int branchBranchIdLength = raw.getShort();
                       byte[] branchBranchId = new byte[branchBranchIdLength];
  @@ -367,11 +367,11 @@
                       String name = new String(nameBytes);
                       TransactionBranchInfoImpl branchInfo = new TransactionBranchInfoImpl(branchXid,
name);
                       branches.add(branchInfo);
  -                    log.info("recovered branch for resource manager, branchId " + name
+ ", " + branchXid);
  +//                    log.info("recovered branch for resource manager, branchId " + name
+ ", " + branchXid);
                   }
               } else if (type == COMMIT || type == ROLLBACK) {
                   Object o = recoveredTx.remove(masterXid);
  -                log.info("Recovered " + TYPE_NAMES[type] + " for xid: " + masterXid + "
and branches: " + o);
  +//                log.info("Recovered " + TYPE_NAMES[type] + " for xid: " + masterXid +
" and branches: " + o);
               } else {
                   log.error("Unknown recovery record received, type byte: " + type + ", buffer:
" + raw);
               }
  
  
  
  1.6       +2 -2      incubator-geronimo/modules/transaction/src/test/org/apache/geronimo/transaction/log/AbstractLogTest.java
  
  Index: AbstractLogTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/transaction/src/test/org/apache/geronimo/transaction/log/AbstractLogTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractLogTest.java	20 Jun 2004 18:45:52 -0000	1.5
  +++ AbstractLogTest.java	22 Jun 2004 18:41:00 -0000	1.6
  @@ -50,7 +50,7 @@
   
       public void testDummy() throws Exception {}
   
  -    public void xtestTransactionLog() throws Exception {
  +    public void testTransactionLog() throws Exception {
           File resultFileXML = new File(getResultFileName() + ".xml");
           resultsXML = new FileWriter(resultFileXML);
           resultsXML.write("<log-test>\n");
  
  
  
  1.2       +21 -9     incubator-geronimo/modules/transaction/src/test/org/apache/geronimo/transaction/log/HOWLLogTest.java
  
  Index: HOWLLogTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/transaction/src/test/org/apache/geronimo/transaction/log/HOWLLogTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HOWLLogTest.java	19 Jun 2004 17:17:13 -0000	1.1
  +++ HOWLLogTest.java	22 Jun 2004 18:41:00 -0000	1.2
  @@ -17,15 +17,12 @@
   
   package org.apache.geronimo.transaction.log;
   
  -import java.io.IOException;
  +import java.io.File;
   
  -import javax.transaction.xa.Xid;
  -
  -import junit.framework.TestCase;
  +import junit.extensions.TestSetup;
  +import junit.framework.Test;
  +import junit.framework.TestSuite;
   import org.apache.geronimo.transaction.manager.TransactionLog;
  -import org.objectweb.howl.log.LogClosedException;
  -import org.objectweb.howl.log.LogFileOverflowException;
  -import org.objectweb.howl.log.Logger;
   
   /**
    *
  @@ -34,6 +31,7 @@
    *
    * */
   public class HOWLLogTest extends AbstractLogTest {
  +    private static final String LOG_FILE_NAME = "howl_test";
   
   
       protected String getResultFileName() {
  @@ -53,7 +51,7 @@
                   20, //                "flushSleepTime",
                   "target", //                "logFileDir",
                   "log", //                "logFileExt",
  -                "howl_test_", //                "logFileName",
  +                LOG_FILE_NAME, //                "logFileName",
                   200, //                "maxBlocksPerFile",
                   10, //                "maxBuffers",
                   2, //                "maxLogFiles",
  @@ -62,6 +60,20 @@
           );
           howlLog.doStart();
           return howlLog;
  +    }
  +    public static Test suite() {
  +        return new TestSetup(new TestSuite(HOWLLogTest.class)) {
  +            protected void setUp() throws Exception {
  +                File logFile = new File("target/" + LOG_FILE_NAME + "_1.log");
  +                if (logFile.exists()) {
  +                    logFile.delete();
  +                }
  +                logFile = new File("target/" + LOG_FILE_NAME + "_2.log");
  +                if (logFile.exists()) {
  +                    logFile.delete();
  +                }
  +            }
  +        };
       }
   
   }
  
  
  
  1.3       +3 -3      incubator-geronimo/modules/transaction/src/test/org/apache/geronimo/transaction/manager/AbstractRecoveryTest.java
  
  Index: AbstractRecoveryTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/transaction/src/test/org/apache/geronimo/transaction/manager/AbstractRecoveryTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractRecoveryTest.java	20 Jun 2004 18:45:52 -0000	1.2
  +++ AbstractRecoveryTest.java	22 Jun 2004 18:41:00 -0000	1.3
  @@ -46,7 +46,7 @@
   
       public void testDummy() throws Exception {}
   
  -    public void xtest2ResOnlineAfterRecoveryStart() throws Exception {
  +    public void test2ResOnlineAfterRecoveryStart() throws Exception {
           Xid[] xids = getXidArray(XID_COUNT);
           MockXAResource xares1 = new MockXAResource(RM1, xids);
           MockXAResource xares2 = new MockXAResource(RM2, xids);
  @@ -68,7 +68,7 @@
           assertTrue(recovery.localRecoveryComplete());
       }
   
  -    public void xtest3ResOnlineAfterRecoveryStart() throws Exception {
  +    public void test3ResOnlineAfterRecoveryStart() throws Exception {
           Xid[] xids12 = getXidArray(XID_COUNT);
           List xids12List = Arrays.asList(xids12);
           Xid[] xids13 = getXidArray(XID_COUNT);
  
  
  
  1.3       +26 -25    incubator-geronimo/modules/transaction/src/test/org/apache/geronimo/transaction/manager/HOWLLogRecoveryTest.java
  
  Index: HOWLLogRecoveryTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/transaction/src/test/org/apache/geronimo/transaction/manager/HOWLLogRecoveryTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HOWLLogRecoveryTest.java	20 Jun 2004 18:45:52 -0000	1.2
  +++ HOWLLogRecoveryTest.java	22 Jun 2004 18:41:00 -0000	1.3
  @@ -31,37 +31,38 @@
    *
    * */
   public class HOWLLogRecoveryTest extends AbstractRecoveryTest {
  +    private static final String LOG_FILE_NAME = "howl_test_";
   
  -    public void xtest2Again() throws Exception {
  -        xtest2ResOnlineAfterRecoveryStart();
  +    public void test2Again() throws Exception {
  +        test2ResOnlineAfterRecoveryStart();
       }
   
  -    public void xtest3Again() throws Exception {
  -        xtest3ResOnlineAfterRecoveryStart();
  +    public void test3Again() throws Exception {
  +        test3ResOnlineAfterRecoveryStart();
       }
   
       protected void setUp() throws Exception {
  -//        HOWLLog howlLog = new HOWLLog(
  -//                "org.objectweb.howl.log.BlockLogBuffer", //                "bufferClassName",
  -//                4, //                "bufferSizeKBytes",
  -//                true, //                "checksumEnabled",
  -//                20, //                "flushSleepTime",
  -//                "target", //                "logFileDir",
  -//                "log", //                "logFileExt",
  -//                "howl_test_", //                "logFileName",
  -//                200, //                "maxBlocksPerFile",
  -//                10, //                "maxBuffers",                       log
  -//                2, //                "maxLogFiles",
  -//                2, //                "minBuffers",
  -//                10//                "threadsWaitingForceThreshold"});
  -//        );
  -//        howlLog.doStart();
  -//        txLog = howlLog;
  +        HOWLLog howlLog = new HOWLLog(
  +                "org.objectweb.howl.log.BlockLogBuffer", //                "bufferClassName",
  +                4, //                "bufferSizeKBytes",
  +                true, //                "checksumEnabled",
  +                20, //                "flushSleepTime",
  +                "target", //                "logFileDir",
  +                "log", //                "logFileExt",
  +                LOG_FILE_NAME, //                "logFileName",
  +                200, //                "maxBlocksPerFile",
  +                10, //                "maxBuffers",                       log
  +                2, //                "maxLogFiles",
  +                2, //                "minBuffers",
  +                10//                "threadsWaitingForceThreshold"});
  +        );
  +        howlLog.doStart();
  +        txLog = howlLog;
       }
   
       protected void tearDown() throws Exception {
  -//        ((HOWLLog)txLog).doStop();
  -//        txLog = null;
  +        ((HOWLLog)txLog).doStop();
  +        txLog = null;
       }
   
       protected void prepareForReplay() throws Exception {
  @@ -72,11 +73,11 @@
       public static Test suite() {
           return new TestSetup(new TestSuite(HOWLLogRecoveryTest.class)) {
               protected void setUp() throws Exception {
  -                File logFile = new File("target/howl_1.log");
  +                File logFile = new File("target/" + LOG_FILE_NAME + "_1.log");
                   if (logFile.exists()) {
                       logFile.delete();
                   }
  -                logFile = new File("target/howl_2.log");
  +                logFile = new File("target/" + LOG_FILE_NAME + "_2.log");
                   if (logFile.exists()) {
                       logFile.delete();
                   }
  
  
  

Mime
View raw message