Package org.h2.test.synth
Class TestHalt
java.lang.Object
org.h2.test.TestBase
org.h2.test.synth.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
FieldsModifier and TypeFieldDescriptionprotected ConnectionThe database connection.protected static final intThis bit flag means the test should use LOB values.protected static final intThis bit flag means operations should be written to the transaction log immediately.protected intThe current flags bit mask.protected static final intThis bit flag means delete operations should be performed.protected static final intThis bit flag means insert operations should be performed.protected static final intThis bit flag means select operations should be performed.protected static final intThis bit flag means update operations should be performed.protected intThe current operations bit mask.protected RandomThe pseudo random number generator used for this test.protected intThe 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected voidClose the database connection normally.protected StringgetRandomString(int len) Create a random string with the specified length.org.h2.test.TestBaseinit(org.h2.test.TestAll conf) Initialize the test configuration.voidtest()This method will be called by the test framework.protected voidPrint a trace message to the trace file.protected voidtraceOperation(String s, 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
-
Field Details
-
OP_INSERT
protected static final int OP_INSERTThis bit flag means insert operations should be performed.- See Also:
-
OP_DELETE
protected static final int OP_DELETEThis bit flag means delete operations should be performed.- See Also:
-
OP_UPDATE
protected static final int OP_UPDATEThis bit flag means update operations should be performed.- See Also:
-
OP_SELECT
protected static final int OP_SELECTThis bit flag means select operations should be performed.- See Also:
-
FLAG_NO_DELAY
protected static final int FLAG_NO_DELAYThis bit flag means operations should be written to the transaction log immediately.- See Also:
-
FLAG_LOBS
protected static final int FLAG_LOBSThis bit flag means the test should use LOB values.- See Also:
-
operations
protected int operationsThe current operations bit mask. -
flags
protected int flagsThe current flags bit mask. -
value
protected int valueThe current test value, for example the number of rows. -
conn
The database connection. -
random
The pseudo random number generator used for this test.
-
-
Constructor Details
-
TestHalt
public TestHalt()
-
-
Method Details
-
test
public void test()Description copied from class:org.h2.test.TestBaseThis method will be called by the test framework.- Specified by:
testin classorg.h2.test.TestBase
-
traceOperation
Print a trace message to the trace file.- Parameters:
s- the message
-
traceOperation
Print a trace message to the trace file.- Parameters:
s- the messagee- the exception or null
-
disconnect
protected void disconnect()Close the database connection normally. -
getRandomString
Create a random string with the specified length.- Parameters:
len- the number of characters- Returns:
- the random string
-
init
Description copied from class:org.h2.test.TestBaseInitialize the test configuration.- Overrides:
initin classorg.h2.test.TestBase- Parameters:
conf- the configuration- Returns:
- itself
- Throws:
Exception
-