Class TestHalt

  • Direct Known Subclasses:
    TestHaltApp

    public abstract class TestHalt
    extends org.h2.test.TestBase
    Tests database recovery by destroying a process that writes to the database.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.h2.test.TestBase

        org.h2.test.TestBase.VoidCallable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.sql.Connection conn
      The database connection.
      protected static int FLAG_LOBS
      This bit flag means the test should use LOB values.
      protected static int FLAG_NO_DELAY
      This bit flag means operations should be written to the transaction log immediately.
      protected int flags
      The current flags bit mask.
      protected static int OP_DELETE
      This bit flag means delete operations should be performed.
      protected static int OP_INSERT
      This bit flag means insert operations should be performed.
      protected static int OP_SELECT
      This bit flag means select operations should be performed.
      protected static int OP_UPDATE
      This bit flag means update operations should be performed.
      protected int operations
      The current operations bit mask.
      protected java.util.Random random
      The pseudo random number generator used for this test.
      protected int value
      The current test value, for example the number of rows.
      • Fields inherited from class org.h2.test.TestBase

        BASE_TEST_DIR, config, start, uniqueId
    • Constructor Summary

      Constructors 
      Constructor Description
      TestHalt()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void disconnect()
      Close the database connection normally.
      protected java.lang.String getRandomString​(int len)
      Create a random string with the specified length.
      org.h2.test.TestBase init​(org.h2.test.TestAll conf)
      Initialize the test configuration.
      void test()
      This method will be called by the test framework.
      protected void traceOperation​(java.lang.String s)
      Print a trace message to the trace file.
      protected void traceOperation​(java.lang.String s, java.lang.Exception e)
      Print a trace message to the trace file.
      • Methods inherited from class org.h2.test.TestBase

        assertContains, assertEmpty, assertEqualDatabases, assertEqualReaders, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualStreams, assertFalse, assertFalse, assertKnownException, assertKnownException, assertNotContaining, assertNotNull, assertNotNull, assertNull, assertResult, assertResultRowCount, assertResultSetMeta, assertResultSetOrdered, assertResultSetOrdered, assertSame, assertSingleValue, assertSmaller, assertStartsWith, assertThrows, assertThrows, assertThrows, assertThrows, assertThrows, assertThrows, assertThrows, assertThrows, assertTrue, assertTrue, checkErrorCode, crash, createCaller, createFailingStream, eatMemory, execute, execute, fail, fail, freeMemory, getBaseDir, getClassPath, getFilePassword, getJVM, getMemoryUsed, getMemoryUsedBytes, getPassword, getPassword, getPowerOffCount, getSize, getTestDir, getTestName, getUser, init, isEnabled, logError, logErrorMessage, println, printTime, printTimeMemory, readString, runTest, setPowerOffCount, testFromMain, throwException, trace, trace, traceMemory
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • OP_INSERT

        protected static final int OP_INSERT
        This bit flag means insert operations should be performed.
        See Also:
        Constant Field Values
      • OP_DELETE

        protected static final int OP_DELETE
        This bit flag means delete operations should be performed.
        See Also:
        Constant Field Values
      • OP_UPDATE

        protected static final int OP_UPDATE
        This bit flag means update operations should be performed.
        See Also:
        Constant Field Values
      • OP_SELECT

        protected static final int OP_SELECT
        This bit flag means select operations should be performed.
        See Also:
        Constant Field Values
      • FLAG_NO_DELAY

        protected static final int FLAG_NO_DELAY
        This bit flag means operations should be written to the transaction log immediately.
        See Also:
        Constant Field Values
      • FLAG_LOBS

        protected static final int FLAG_LOBS
        This bit flag means the test should use LOB values.
        See Also:
        Constant Field Values
      • operations

        protected int operations
        The current operations bit mask.
      • flags

        protected int flags
        The current flags bit mask.
      • value

        protected int value
        The current test value, for example the number of rows.
      • conn

        protected java.sql.Connection conn
        The database connection.
      • random

        protected java.util.Random random
        The pseudo random number generator used for this test.
    • Constructor Detail

      • TestHalt

        public TestHalt()
    • Method Detail

      • test

        public void test()
        Description copied from class: org.h2.test.TestBase
        This method will be called by the test framework.
        Specified by:
        test in class org.h2.test.TestBase
      • traceOperation

        protected void traceOperation​(java.lang.String s)
        Print a trace message to the trace file.
        Parameters:
        s - the message
      • traceOperation

        protected void traceOperation​(java.lang.String s,
                                      java.lang.Exception e)
        Print a trace message to the trace file.
        Parameters:
        s - the message
        e - the exception or null
      • disconnect

        protected void disconnect()
        Close the database connection normally.
      • getRandomString

        protected java.lang.String getRandomString​(int len)
        Create a random string with the specified length.
        Parameters:
        len - the number of characters
        Returns:
        the random string
      • init

        public org.h2.test.TestBase init​(org.h2.test.TestAll conf)
                                  throws java.lang.Exception
        Description copied from class: org.h2.test.TestBase
        Initialize the test configuration.
        Overrides:
        init in class org.h2.test.TestBase
        Parameters:
        conf - the configuration
        Returns:
        itself
        Throws:
        java.lang.Exception