public class UpdateLocksTest extends BaseJDBCTestCase
updatelocks.sql
in the old
harness. The structure of this JUnit test mirrors the old test closely.
It contains a test fixture for each isolation level, e.g. four.Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
_a |
private static java.lang.String |
_A |
private static java.lang.String |
_app |
private static java.lang.String |
_g |
private static java.lang.String |
_IX |
private static java.lang.String |
_r |
private static java.lang.String |
_t |
private static java.lang.String |
_tl |
private static java.lang.String |
_U |
private static java.lang.String |
_ut |
private static java.lang.String |
_X |
private java.sql.PreparedStatement |
getLocksQuery |
private static java.lang.String |
lock_table_query |
private static int |
NO_IDX_1 |
private static int |
NO_IDX_2 |
private static int |
NON_UNIQUE_INDEX |
private static int |
UNIQUE_INDEX |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
UpdateLocksTest(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
private void |
assertRow(java.sql.ResultSet rs,
java.lang.String[] expected) |
private void |
doRunTests(int isolation,
boolean withhold) |
private java.sql.ResultSet |
getLocks() |
private void |
insertValuesUnpaddedVarchar(java.sql.Statement s) |
private static java.lang.String |
pad2(java.lang.String s,
int i) |
void |
setUp() |
static junit.framework.Test |
suite() |
void |
tearDown()
Tear down this fixture, sub-classes should call
super.tearDown().
|
void |
testReadCommitted() |
void |
testReadCommittedJDBC30() |
void |
testReadUncommitted() |
void |
testReadUncommittedJDBC30() |
void |
testRepeatableRead()
Should be the same as SERIALIZABLE results except no previous key locks.
|
void |
testRepeatableReadJDBC30() |
void |
testSerializable() |
void |
testSerializableJDBC30() |
private void |
updateBtreeCursorLocks1(java.sql.Connection c,
int isolation,
int mode,
boolean unPadded,
int pad,
int idxPad,
boolean withhold) |
private void |
updateBtreeCursorLocks2(java.sql.Connection c,
int isolation,
int mode,
boolean unPadded,
int pad,
int idxPad,
boolean withhold) |
private void |
updateBtreeSetLocks(java.sql.Connection c,
int isolation,
int mode,
boolean unPadded,
int pad,
int idxPad) |
private void |
updatecursorlocks(java.sql.Connection c,
int isolation,
int pad,
int mode,
boolean withhold) |
private void |
updatesetlocks(java.sql.Connection c,
int isolation,
int pad,
int mode)
Assumes that calling routine has set up the following simple dataset,
a heap, no indexes with following initial values:
create table (a int, b int, c somesortofchar);
1, 10, 'one'
2, 20, 'two'
3, 30, 'three'
4, 40, 'four'
5, 50, 'five'
6, 60, 'six'
7, 70, 'seven'
|
private void |
verifyRsMetaData(java.sql.ResultSet s) |
assertCallError, assertCheckTable, assertCommitError, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertResults, assertResults, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, chattyPrepare, chattyPrepareCall, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, dumpRs, dumpRs, emptyStatementCache, executeQuery, expectCompilationError, expectCompilationError, expectExecutionError, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, goodStatement, goodUpdate, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, usingDB2Client, usingDerbyNetClient, usingEmbedded
alarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSameNullness, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, newAssertionFailedError, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemErr, setSystemOut, setSystemProperty, sleep, sleepAtLeastOneTick, traceit, vmAtLeast
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, toString
private static final int UNIQUE_INDEX
private static final int NON_UNIQUE_INDEX
private static final int NO_IDX_1
private static final int NO_IDX_2
private static final java.lang.String _g
private static final java.lang.String _a
private static final java.lang.String _app
private static final java.lang.String _ut
private static final java.lang.String _t
private static final java.lang.String _r
private static final java.lang.String _tl
private static final java.lang.String _A
private static final java.lang.String _X
private static final java.lang.String _IX
private static final java.lang.String _U
private java.sql.PreparedStatement getLocksQuery
private static final java.lang.String lock_table_query
public void setUp() throws java.lang.Exception
setUp
in class junit.framework.TestCase
java.lang.Exception
public void tearDown() throws java.lang.Exception
BaseJDBCTestCase
tearDown
in class BaseJDBCTestCase
java.lang.Exception
public static junit.framework.Test suite()
public void testRepeatableRead() throws java.lang.Exception
java.lang.Exception
public void testReadCommitted() throws java.lang.Exception
java.lang.Exception
public void testSerializable() throws java.lang.Exception
java.lang.Exception
public void testReadUncommitted() throws java.lang.Exception
java.lang.Exception
public void testRepeatableReadJDBC30() throws java.lang.Exception
java.lang.Exception
public void testReadCommittedJDBC30() throws java.lang.Exception
java.lang.Exception
public void testSerializableJDBC30() throws java.lang.Exception
java.lang.Exception
public void testReadUncommittedJDBC30() throws java.lang.Exception
java.lang.Exception
private void insertValuesUnpaddedVarchar(java.sql.Statement s) throws java.sql.SQLException
java.sql.SQLException
private void doRunTests(int isolation, boolean withhold) throws java.lang.Exception
java.lang.Exception
private void updatecursorlocks(java.sql.Connection c, int isolation, int pad, int mode, boolean withhold) throws java.sql.SQLException
java.sql.SQLException
private void updatesetlocks(java.sql.Connection c, int isolation, int pad, int mode) throws java.sql.SQLException
java.sql.SQLException
private void updateBtreeCursorLocks1(java.sql.Connection c, int isolation, int mode, boolean unPadded, int pad, int idxPad, boolean withhold) throws java.sql.SQLException
java.sql.SQLException
private void updateBtreeCursorLocks2(java.sql.Connection c, int isolation, int mode, boolean unPadded, int pad, int idxPad, boolean withhold) throws java.sql.SQLException
java.sql.SQLException
private void updateBtreeSetLocks(java.sql.Connection c, int isolation, int mode, boolean unPadded, int pad, int idxPad) throws java.sql.SQLException
java.sql.SQLException
private void verifyRsMetaData(java.sql.ResultSet s) throws java.sql.SQLException
java.sql.SQLException
private void assertRow(java.sql.ResultSet rs, java.lang.String[] expected) throws java.sql.SQLException
java.sql.SQLException
private static java.lang.String pad2(java.lang.String s, int i)
private java.sql.ResultSet getLocks() throws java.sql.SQLException
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.