TestHalt

Tests database recovery by destroying a process that writes to the database.

Methods
void controllerCheckAfterCrash()
Check if the database is consistent after a simulated database crash.
void controllerCheckAfterCrash() throws SQLException
Check if the database is consistent after a simulated database crash.
void controllerInit()
Initialize the test.
void controllerInit() throws SQLException
Initialize the test.
void controllerTest()
Run one test.
void controllerTest() throws Exception
Run one test. The controller starts the process, waits, kills the process, and checks if everything is ok.
void controllerWaitAfterAppStart()
Wait for some time after the application has been started.
void controllerWaitAfterAppStart() throws Exception
Wait for some time after the application has been started.
void disconnect()
Close the database connection normally.
void disconnect()
Close the database connection normally.
Connection getConnection()
Connection getConnection() throws SQLException
String getRandomString(int len)
Create a random string with the specified length.
String getRandomString(int len)
Create a random string with the specified length.
Parameters:
len - the number of characters
Returns:
the random string
TestBase init(TestAll conf)
TestBase init(TestAll conf) throws Exception
void processAppRun()
Run the application.
void processAppRun() throws SQLException
Run the application.
void processAppStart()
Start the application.
void processAppStart() throws SQLException
Start the application.
void processRunRandom()
The second process starts the application and executes random operations.
void processRunRandom() throws SQLException
The second process starts the application and executes random operations.
void test()
void test()
void traceOperation(String s)
Print a trace message to the trace file.
void traceOperation(String s)
Print a trace message to the trace file.
Parameters:
s - the message
void traceOperation(String s, Exception e)
Print a trace message to the trace file.
void traceOperation(String s, Exception e)
Print a trace message to the trace file.
Parameters:
s - the message
e - the exception or null

Fields
static int FLAG_LOBS = 2
static int FLAG_NO_DELAY = 1
static int OP_DELETE = 2
static int OP_INSERT = 1
static int OP_SELECT = 8
static int OP_UPDATE = 4
static Connection conn
static int flags
static int operations
static Random random
static int value

FLAG_NO_DELAY = 1

This bit flag means operations should be written to the transaction log immediately.

OP_INSERT = 1

This bit flag means insert operations should be performed.

FLAG_LOBS = 2

This bit flag means the test should use LOB values.

OP_DELETE = 2

This bit flag means delete operations should be performed.

OP_UPDATE = 4

This bit flag means update operations should be performed.

OP_SELECT = 8

This bit flag means select operations should be performed.

conn

The database connection.

flags

The current flags bit mask.

operations

The current operations bit mask.

random

The pseudo random number generator used for this test.

value

The current test value, for example the number of rows.