Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derbyTesting.unitTests.store
Class T_RecoverBadLog  view T_RecoverBadLog download T_RecoverBadLog.java

java.lang.Object
  extended byorg.apache.derbyTesting.unitTests.harness.T_Generic
      extended byorg.apache.derbyTesting.unitTests.store.T_RecoverBadLog
All Implemented Interfaces:
org.apache.derby.iapi.services.monitor.ModuleControl, org.apache.derbyTesting.unitTests.harness.UnitTest

public class T_RecoverBadLog
extends org.apache.derbyTesting.unitTests.harness.T_Generic

A implementation unit test for recovering log that has been damanged but salvagable. To run, create a derby.properties file in a new directory with the contents derby.module.test.recoverBadLog=org.apache.derbyTesting.unitTests.store.T_RecoverBadLog Execute in order To Test Bad Log due to partial write that are identified by checking the length in the beginning and end of the log record. java -DTestBadLogSetup=true org.apache.derbyTesting.unitTests.harness.UnitTestMain java -DTestBadLog1=true org.apache.derbyTesting.unitTests.harness.UnitTestMain java -DTestBadLog2=true org.apache.derbyTesting.unitTests.harness.UnitTestMain java -DTestBadLog3=true org.apache.derbyTesting.unitTests.harness.UnitTestMain java -DTestBadLog4=true org.apache.derbyTesting.unitTests.harness.UnitTestMain java -DTestBadLog5=true org.apache.derbyTesting.unitTests.harness.UnitTestMain java -DTestBadLog6=true org.apache.derbyTesting.unitTests.harness.UnitTestMain java -DTestBadLog7=true org.apache.derbyTesting.unitTests.harness.UnitTestMain java -DTestBadLog1=true org.apache.derbyTesting.unitTests.harness.UnitTestMain To Test Bad Log due to an incomplete out of order write that is identified by the checksum logic (simulated by explicitly corrupting a middle of a log record at the end of log file after it is written). java -DTestBadLogSetup=true -DTestBadChecksumLog=true org.apache.derbyTesting.unitTests.harness.UnitTestMain java -DTestBadLog1=true -DTestBadChecksumLog=true org.apache.derbyTesting.unitTests.harness.UnitTestMain java -DTestBadLog2=true -DTestBadChecksumLog=true org.apache.derbyTesting.unitTests.harness.UnitTestMain java -DTestBadLog3=true -DTestBadChecksumLog=true org.apache.derbyTesting.unitTests.harness.UnitTestMain java -DTestBadLog4=true -DTestBadChecksumLog=true org.apache.derbyTesting.unitTests.harness.UnitTestMain java -DTestBadLog5=true -DTestBadChecksumLog=true org.apache.derbyTesting.unitTests.harness.UnitTestMain java -DTestBadLog6=true -DTestBadChecksumLog=true org.apache.derbyTesting.unitTests.harness.UnitTestMain java -DTestBadLog7=true -DTestBadChecksumLog=true org.apache.derbyTesting.unitTests.harness.UnitTestMain java -DTestBadLog1=true -DTestBadChecksumLog=true org.apache.derbyTesting.unitTests.harness.UnitTestMain


Field Summary
private  boolean checksumTest
           
(package private)  org.apache.derby.iapi.services.context.ContextService contextService
           
(package private)  org.apache.derby.iapi.store.raw.RawStoreFactory factory
           
private  java.io.RandomAccessFile infofile
           
private  java.lang.String infoPath
           
(package private)  org.apache.derby.iapi.services.locks.LockFactory lf
           
(package private)  org.apache.derby.impl.store.raw.log.LogToFile logFactory
           
(package private) static java.lang.String REC_001
           
(package private) static java.lang.String REC_002
           
(package private) static java.lang.String REC_003
           
(package private) static java.lang.String REC_004
           
(package private) static java.lang.String REC_005
           
(package private) static java.lang.String REC_006
           
(package private) static java.lang.String REC_UNDO
           
private  boolean setup
           
(package private) static java.lang.String SP1
           
(package private) static java.lang.String SP2
           
(package private)  T_Util t_util
           
private static java.lang.String TEST_BAD_CHECKSUM_LOG
           
private static java.lang.String TEST_BADCHECKSUMLOG_INFO
           
private static java.lang.String TEST_BADLOG_INFO
           
private static java.lang.String TEST_BADLOG_SETUP
           
private static java.lang.String TEST_BADLOG1
           
private static java.lang.String TEST_BADLOG2
           
private static java.lang.String TEST_BADLOG3
           
private static java.lang.String TEST_BADLOG4
           
private static java.lang.String TEST_BADLOG5
           
private static java.lang.String TEST_BADLOG6
           
private static java.lang.String TEST_BADLOG7
           
private  boolean test1
           
private  boolean test2
           
private  boolean test3
           
private  boolean test4
           
private  boolean test5
           
private  boolean test6
           
private  boolean test7
           
private  java.lang.String testService
           
 
Fields inherited from class org.apache.derbyTesting.unitTests.harness.T_Generic
out, shortModuleToTestName, startParams
 
Constructor Summary
T_RecoverBadLog()
           
 
Method Summary
private  long find(long inkey)
           
private  void getConfig()
           
 java.lang.String getModuleToTestProtocolName()
          Get the name of the protocol for the module to test.
private  long key(int test, int param)
           
private  void register(long key, long value)
           
(package private)  void RTest1()
           
(package private)  void RTest2()
           
(package private)  void RTest3()
           
(package private)  void RTest4()
           
(package private)  void RTest5()
           
(package private)  void RTest6()
           
(package private)  void RTest7()
           
 void runTests()
          See T_Recovery for the general testing frame work
private  void simulateLogFileCorruption()
           
protected  void STest1()
           
protected  void STest2()
           
protected  void STest3()
           
protected  void STest4()
           
protected  void STest5()
           
protected  void STest6()
           
protected  void STest7()
           
 
Methods inherited from class org.apache.derbyTesting.unitTests.harness.T_Generic
boot, Execute, FAIL, PASS, REPORT, stop, UnitTestDuration, UnitTestType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

testService

private java.lang.String testService

REC_001

static final java.lang.String REC_001
See Also:
Constant Field Values

REC_002

static final java.lang.String REC_002
See Also:
Constant Field Values

REC_003

static final java.lang.String REC_003
See Also:
Constant Field Values

REC_004

static final java.lang.String REC_004
See Also:
Constant Field Values

REC_005

static final java.lang.String REC_005
See Also:
Constant Field Values

REC_006

static final java.lang.String REC_006
See Also:
Constant Field Values

REC_UNDO

static final java.lang.String REC_UNDO
See Also:
Constant Field Values

SP1

static final java.lang.String SP1
See Also:
Constant Field Values

SP2

static final java.lang.String SP2
See Also:
Constant Field Values

infofile

private java.io.RandomAccessFile infofile

setup

private boolean setup

test1

private boolean test1

test2

private boolean test2

test3

private boolean test3

test4

private boolean test4

test5

private boolean test5

test6

private boolean test6

test7

private boolean test7

checksumTest

private boolean checksumTest

infoPath

private java.lang.String infoPath

TEST_BADLOG_SETUP

private static final java.lang.String TEST_BADLOG_SETUP
See Also:
Constant Field Values

TEST_BADLOG1

private static final java.lang.String TEST_BADLOG1
See Also:
Constant Field Values

TEST_BADLOG2

private static final java.lang.String TEST_BADLOG2
See Also:
Constant Field Values

TEST_BADLOG3

private static final java.lang.String TEST_BADLOG3
See Also:
Constant Field Values

TEST_BADLOG4

private static final java.lang.String TEST_BADLOG4
See Also:
Constant Field Values

TEST_BADLOG5

private static final java.lang.String TEST_BADLOG5
See Also:
Constant Field Values

TEST_BADLOG6

private static final java.lang.String TEST_BADLOG6
See Also:
Constant Field Values

TEST_BADLOG7

private static final java.lang.String TEST_BADLOG7
See Also:
Constant Field Values

TEST_BAD_CHECKSUM_LOG

private static final java.lang.String TEST_BAD_CHECKSUM_LOG
See Also:
Constant Field Values

TEST_BADLOG_INFO

private static final java.lang.String TEST_BADLOG_INFO
See Also:
Constant Field Values

TEST_BADCHECKSUMLOG_INFO

private static final java.lang.String TEST_BADCHECKSUMLOG_INFO
See Also:
Constant Field Values

factory

org.apache.derby.iapi.store.raw.RawStoreFactory factory

lf

org.apache.derby.iapi.services.locks.LockFactory lf

logFactory

org.apache.derby.impl.store.raw.log.LogToFile logFactory

contextService

org.apache.derby.iapi.services.context.ContextService contextService

t_util

T_Util t_util
Constructor Detail

T_RecoverBadLog

public T_RecoverBadLog()
Method Detail

getModuleToTestProtocolName

public java.lang.String getModuleToTestProtocolName()
Description copied from class: org.apache.derbyTesting.unitTests.harness.T_Generic
Get the name of the protocol for the module to test. This is the 'factory.MODULE' variable. 'moduleName' to the name of the module to test.


getConfig

private void getConfig()

runTests

public void runTests()
              throws org.apache.derbyTesting.unitTests.harness.T_Fail
See T_Recovery for the general testing frame work


find

private long find(long inkey)

key

private long key(int test,
                 int param)

register

private void register(long key,
                      long value)
               throws org.apache.derbyTesting.unitTests.harness.T_Fail

STest1

protected void STest1()
               throws org.apache.derbyTesting.unitTests.harness.T_Fail,
                      org.apache.derby.iapi.error.StandardException

RTest1

void RTest1()
      throws org.apache.derbyTesting.unitTests.harness.T_Fail,
             org.apache.derby.iapi.error.StandardException

STest2

protected void STest2()
               throws org.apache.derbyTesting.unitTests.harness.T_Fail,
                      org.apache.derby.iapi.error.StandardException

RTest2

void RTest2()
      throws org.apache.derbyTesting.unitTests.harness.T_Fail,
             org.apache.derby.iapi.error.StandardException

STest3

protected void STest3()
               throws org.apache.derbyTesting.unitTests.harness.T_Fail,
                      org.apache.derby.iapi.error.StandardException

RTest3

void RTest3()
      throws org.apache.derbyTesting.unitTests.harness.T_Fail,
             org.apache.derby.iapi.error.StandardException

STest4

protected void STest4()
               throws org.apache.derbyTesting.unitTests.harness.T_Fail,
                      org.apache.derby.iapi.error.StandardException

RTest4

void RTest4()
      throws org.apache.derbyTesting.unitTests.harness.T_Fail,
             org.apache.derby.iapi.error.StandardException

STest5

protected void STest5()
               throws org.apache.derbyTesting.unitTests.harness.T_Fail,
                      org.apache.derby.iapi.error.StandardException

RTest5

void RTest5()
      throws org.apache.derbyTesting.unitTests.harness.T_Fail,
             org.apache.derby.iapi.error.StandardException

STest6

protected void STest6()
               throws org.apache.derbyTesting.unitTests.harness.T_Fail,
                      org.apache.derby.iapi.error.StandardException

RTest6

void RTest6()
      throws org.apache.derbyTesting.unitTests.harness.T_Fail,
             org.apache.derby.iapi.error.StandardException

STest7

protected void STest7()
               throws org.apache.derbyTesting.unitTests.harness.T_Fail,
                      org.apache.derby.iapi.error.StandardException

RTest7

void RTest7()
      throws org.apache.derbyTesting.unitTests.harness.T_Fail,
             org.apache.derby.iapi.error.StandardException

simulateLogFileCorruption

private void simulateLogFileCorruption()
                                throws org.apache.derbyTesting.unitTests.harness.T_Fail,
                                       org.apache.derby.iapi.error.StandardException