public abstract class BaseTest
extends java.lang.Object
If more than one store tests wants a function, put it here rather than copy it. Hopefully going forward, with enough utility functions adding new store tests will be easier. New store tests should extend this test to pick up access to utility routines - see OnlineCompressTest.java as an example.
Modifier and Type | Field and Description |
---|---|
private static boolean |
debug_system_procedures_created |
protected static int |
SPACE_INFO_ESTIMSPACESAVING |
protected static int |
SPACE_INFO_IS_INDEX
call the space table vti.
|
protected static int |
SPACE_INFO_NUM_ALLOC |
protected static int |
SPACE_INFO_NUM_FREE |
protected static int |
SPACE_INFO_NUM_UNFILLED |
protected static int |
SPACE_INFO_NUMCOLS |
protected static int |
SPACE_INFO_PAGE_SIZE |
protected static boolean |
verbose |
Constructor and Description |
---|
BaseTest() |
Modifier and Type | Method and Description |
---|---|
protected void |
beginTest(java.sql.Connection conn,
java.lang.String str) |
protected boolean |
checkAllConsistency(java.sql.Connection conn)
Call consistency checker on all the tables.
|
protected boolean |
checkConsistency(java.sql.Connection conn,
java.lang.String schemaName,
java.lang.String tableName)
Call consistency checker on the table.
|
protected void |
createDebugSystemProcedures(java.sql.Connection conn)
Create a system procedures to access SANE debug table routines.
|
void |
createTable(java.sql.Connection conn,
java.lang.String tbl_name,
java.lang.String create_str)
create given table on the input connection.
|
(package private) java.lang.String |
dump_table(java.sql.Connection conn,
java.lang.String schemaName,
java.lang.String tableName,
boolean commit_transaction)
Return string with table information.
|
protected void |
endTest(java.sql.Connection conn,
java.lang.String str) |
void |
executeQuery(java.sql.Connection conn,
java.lang.String stmt_str,
boolean commit_query)
Simple wrapper to execute a sql string.
|
protected java.lang.String |
get_lock_info(java.sql.Connection conn,
boolean include_system_locks)
Get lock table.
|
protected int[] |
getSpaceInfo(java.sql.Connection conn,
java.lang.String schemaName,
java.lang.String tableName,
boolean commit_xact) |
protected void |
log(java.lang.String str) |
protected void |
logError(java.lang.String str) |
(package private) void |
runTests(java.lang.String[] argv) |
abstract void |
testList(java.sql.Connection conn) |
protected void |
testProgress(java.lang.String str) |
protected int |
total_pages(int[] space_info)
Given output from getSpaceInfo(), return total pages in file.
|
private static boolean debug_system_procedures_created
protected static boolean verbose
protected static final int SPACE_INFO_IS_INDEX
Utility test function to call the space table vti to get information about allocated and free pages. Information is passed back in an int array as follows: is_index = ret_info[0]; num_alloc = ret_info[1]; num_free = ret_info[2]; page_size = ret_info[3]; estimate_space_savings = ret_info[4];
protected static final int SPACE_INFO_NUM_ALLOC
protected static final int SPACE_INFO_NUM_FREE
protected static final int SPACE_INFO_NUM_UNFILLED
protected static final int SPACE_INFO_PAGE_SIZE
protected static final int SPACE_INFO_ESTIMSPACESAVING
protected static final int SPACE_INFO_NUMCOLS
public abstract void testList(java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
void runTests(java.lang.String[] argv) throws java.lang.Throwable
java.lang.Throwable
protected void beginTest(java.sql.Connection conn, java.lang.String str) throws java.sql.SQLException
java.sql.SQLException
protected void testProgress(java.lang.String str) throws java.sql.SQLException
java.sql.SQLException
protected void endTest(java.sql.Connection conn, java.lang.String str) throws java.sql.SQLException
java.sql.SQLException
protected void log(java.lang.String str)
protected void logError(java.lang.String str)
public void executeQuery(java.sql.Connection conn, java.lang.String stmt_str, boolean commit_query) throws java.sql.SQLException
java.sql.SQLException
protected boolean checkConsistency(java.sql.Connection conn, java.lang.String schemaName, java.lang.String tableName) throws java.sql.SQLException
java.sql.SQLException
protected boolean checkAllConsistency(java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
protected void createDebugSystemProcedures(java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
java.lang.String dump_table(java.sql.Connection conn, java.lang.String schemaName, java.lang.String tableName, boolean commit_transaction) throws java.sql.SQLException
Dumps summary store information about the table, also dumps extra information about individual pages into the error log file.
java.sql.SQLException
protected java.lang.String get_lock_info(java.sql.Connection conn, boolean include_system_locks) throws java.sql.SQLException
Returns a single string with a dump of the entire lock table.
conn
- The connection to use.include_system_locks
- If true include non-user locks like those
requested by background internal threads.java.sql.SQLException
public void createTable(java.sql.Connection conn, java.lang.String tbl_name, java.lang.String create_str) throws java.sql.SQLException
Takes care of dropping the table if it exists already.
StandardException
- Standard exception policy.java.sql.SQLException
protected int[] getSpaceInfo(java.sql.Connection conn, java.lang.String schemaName, java.lang.String tableName, boolean commit_xact) throws java.sql.SQLException
java.sql.SQLException
protected int total_pages(int[] space_info)
simply the sum of allocated and free pages.
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.