Package org.h2.store

Class RecoverTester

  • All Implemented Interfaces:
    Recorder

    public class RecoverTester
    extends java.lang.Object
    implements Recorder
    A tool that simulates a crash while writing to the database, and then verifies the database doesn't get corrupt.
    • Field Detail

      • testDatabase

        private java.lang.String testDatabase
      • writeCount

        private int writeCount
      • testEvery

        private int testEvery
      • maxFileSize

        private final long maxFileSize
      • verifyCount

        private int verifyCount
      • knownErrors

        private final java.util.HashSet<java.lang.String> knownErrors
      • testing

        private volatile boolean testing
    • Constructor Detail

      • RecoverTester

        public RecoverTester()
    • Method Detail

      • init

        public static void init​(java.lang.String recoverTest)
        Initialize the recover test.
        Parameters:
        recoverTest - the value of the recover test parameter
      • log

        public void log​(int op,
                        java.lang.String fileName,
                        byte[] data,
                        long x)
        Description copied from interface: Recorder
        Record the method.
        Specified by:
        log in interface Recorder
        Parameters:
        op - the operation
        fileName - the file name or file name list
        data - the data or null
        x - the value or 0
      • testDatabase

        private void testDatabase​(java.lang.String fileName,
                                  java.io.PrintWriter out)
      • setTestEvery

        public void setTestEvery​(int testEvery)