public class SURTest extends SURBaseTest
CURSOR_NOT_POSITIONED_ON_INSERT_ROW, CURSOR_NOT_UPDATABLE_SQL_STATE, CURSOR_OPERATION_CONFLICT, FOR_UPDATE_NOT_PERMITTED_SQL_STATE, INVALID_CURSOR_STATE_NO_CURRENT_ROW, LOCK_TIMEOUT_EXPRESSION_SQL_STATE, LOCK_TIMEOUT_SQL_STATE, QUERY_NOT_QUALIFIED_FOR_UPDATABLE_RESULTSET, recordCount, RESULTSET_NOT_UPDATABLE_SQL_STATEDEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE| Constructor and Description |
|---|
SURTest(java.lang.String name)
Creates a new instance of SURTest
|
| Modifier and Type | Method and Description |
|---|---|
private static junit.framework.Test |
baseSuite(java.lang.String name)
The suite contains all testcases in this class running on different
data models
|
private void |
checkDetectabilityCallsOutsideRow(java.sql.ResultSet rs,
java.lang.String state)
Check that detectability methods throw the correct exception
when called in an illegal row state, that is, somehow not
positioned on a row.
|
private java.lang.String |
getNextCursorName()
Get a cursor name.
|
static junit.framework.Test |
suite()
Run the base suite in embedded and client mode.
|
void |
testConcurrencyModeWarning1()
Test that you get a warning when specifying a query which is not
updatable and concurrency mode CONCUR_UPDATABLE.
|
void |
testConcurrencyModeWarning2()
Test that you get a warning when specifying a query which is not
updatable and concurrency mode CONCUR_UPDATABLE.
|
void |
testCursorOperationConflictWarning1()
Test that you get cursor operation conflict warning if updating
a row which has been deleted from the table.
|
void |
testCursorOperationConflictWarning2()
Test that you get cursor operation conflict warning if updating
a row which has been deleted from the table, now using
positioned updates / deletes.
|
private void |
testCursorStateAfterCommit(boolean positioned,
int resultSetType)
Test that when doing an update immediately after
a commit, the update fails, because the cursor has been
postioned between the current row and the next row.
|
void |
testCursorStateAfterCommit1()
Test that when doing an update immediately after
a commit, the update fails, because the cursor has been
postioned between the current row and the next row.
|
void |
testCursorStateAfterCommit2()
Test that when doing an update immediately after
a commit, the update fails, because the cursor has been
postioned between the current row and the next row.
|
void |
testCursorStateAfterCommit3()
Test that when doing an update immediately after
a commit, the update fails, because the cursor has been
postioned between the current row and the next row.
|
void |
testCursorStateAfterCommit4()
Test that when doing an update immediately after
a commit, the update fails, because the cursor has been
postioned between the current row and the next row.
|
void |
testDetectabilityExceptions()
Test that the JDBC detectability calls throw correct exceptions when
called in in wrong row states.
|
void |
testDowngradeToScrollReadOnly()
DERBY-1481 - ResultSet.beforeFirst() gives protocol error on scrollable,
updatable result sets that are downgraded to read-only
Check that no exception is thrown when calling positioning methods on a
result set that has been downgraded to read-only.
|
void |
testFailOnUpdateOfReadOnlyResultSet1()
Test that you get an exception if you try to update a ResultSet
with concurrency mode CONCUR_READ_ONLY.
|
void |
testFailOnUpdateOfReadOnlyResultSet2()
Test that you get an exception when attempting to update a
ResultSet which has been downgraded to a read only ResultSet.
|
void |
testFailOnUpdateOfReadOnlyResultSet3()
Test that you get an exception when attempting to update a
ResultSet which has been downgraded to a read only ResultSet.
|
void |
testFailOnUpdateOfReadOnlyResultSet4()
Test that you get an exception when attempting to update a
ResultSet which has been downgraded to a read only ResultSet.
|
void |
testFailOnUpdateOfReadOnlyResultSet5()
Test that you get an exception if you try to update a ResultSet
with concurrency mode CONCUR_READ_ONLY.
|
void |
testForUpdateException1()
Test that you get an exception when specifying update clause
"FOR UPDATE"
along with a query which is not updatable.
|
void |
testForUpdateException2()
Test that you get an exception when specifying update clause
"FOR UPDATE" along with a query which is not updatable.
|
void |
testForUpdateWithColumnList()
DERBY-4198 "When using the FOR UPDATE OF clause with SUR
(Scroll-insensive updatable result sets), the updateRow() method crashes"
This bug revealed missing logic to handle the fact the the ExecRow
passed down to ScrollInsensitiveResultSet.updateRow does not always
contain all the rows of the basetable, cf. the logic of RowChangerImpl.
|
void |
testForwardOnlyConcurUpdatableWithForUpdate1()
Test updating a forward only resultset (with FOR UPDATE)
|
void |
testForwardOnlyConcurUpdatableWithoutForUpdate1()
Test updating a forward only resultset (without FOR UPDATE)
|
void |
testForwardOnlyReadOnly1()
Test that you can scroll forward and read all records in the
ResultSet
|
void |
testIndexedScrollInsensitiveUpdateCursorWithForUpdate1()
Test that you can scroll forward and update indexed records
in the scrollable ResultSet (using FOR UPDATE).
|
void |
testIndexedScrollInsensitiveUpdateCursorWithoutForUpdate1()
Test that you can scroll forward and update indexed records
in the scrollable ResultSet (not using FOR UPDATE).
|
void |
testIndexedUpdateCursor1()
Test that you can scroll forward and update indexed records in
the ResultSet (not using FOR UPDATE)
|
void |
testIndexedUpdateCursor2()
Test that you can scroll forward and update indexed records
in the ResultSet (using FOR UPDATE).
|
void |
testInsertRowWithScrollCursor()
Tests that it is possible to move using positioning methods after
moveToInsertRow and that it is possible to delete a row after
positioning back from insertRow.
|
void |
testMultipleKeyUpdates()
Update multiple keyed records using scrollable updatable resultset
|
void |
testMultiUpdateRow1()
Test that you can correctly run multiple updateXXX() + updateRow()
combined with cancelRowUpdates().
|
void |
testMultiUpdateRow2()
Test that you can correctly run multiple updateNull() + updateRow()
combined with cancelRowUpdates().
|
void |
testOtherAndOwnPrimaryKeyUpdate1()
Test update of a keyed record using other both the
scrollable updatable resultset and using another statement
object.
|
void |
testOtherPrimaryKeyUpdate1()
Test update of a keyed record using other statement
object.
|
void |
testOtherSecondaryKeyUpdate1()
Test update indexed records using other statement object
and using resultset.
|
void |
testPositionedUpdateWithForUpdate1()
Test updating a forward only resultset (with FOR UPDATE)
and using positioned update
|
void |
testPositionedUpdateWithoutForUpdate1()
Test updating a forward only resultset (without FOR UPDATE)
and using positioned update
|
void |
testPrimaryKeyUpdate1()
Test update of a keyed record using scrollable updatable
resultset.
|
void |
testRowUpdatedAndRowDeleted()
Test that rowUpdated() and rowDeleted() methods both return true when
the row has first been updated and then deleted using the updateRow()
and deleteRow() methods.
|
void |
testScrollablePositionedUpdateWithForUpdate1()
Test positioned update of a scrollable resultset (with FOR UPDATE)
|
private void |
testScrollInsensistiveConurUpdatable3(java.sql.ResultSet rs)
Test update of a scrollable resultset
Scrolling forward and backward.
|
void |
testScrollInsensitiveConcurUpdatableWithForUpdate1()
Test update of a scrollable resultset (with FOR UPDATE)
Only scrolling forward
|
void |
testScrollInsensitiveConcurUpdatableWithForUpdate2()
Test update of a scrollable resultset (with FOR UPDATE)
Scrolling forward and backward.
|
void |
testScrollInsensitiveConcurUpdatableWithForUpdate3()
Test update of a scrollable resultset (with FOR UPDATE)
Scrolling forward and backward.
|
void |
testScrollInsensitiveConcurUpdatableWithoutForUpdate1()
Test update of a scrollable resultset (without FOR UPDATE)
Scrolling forward only
|
void |
testScrollInsensitiveConcurUpdatableWithoutForUpdate2()
Test update of a scrollable resultset (without FOR UPDATE)
Scrolling forward and backward.
|
void |
testScrollInsensitiveConcurUpdatableWithoutForUpdate3()
Test update of a scrollable resultset (without FOR UPDATE)
Scrolling forward and backward.
|
void |
testScrollInsensitiveReadOnly1()
Test scrolling in a read only resultset
|
void |
testSecondaryIndexKeyUpdate1()
Test update indexed records using scrollable updatable resultset
|
assertFailOnUpdate, assertWarning, initializeConnection, scrollBackward, scrollBackwardAndUpdate, scrollBackwardAndUpdatePositioned, scrollForward, scrollForwardAndUpdate, scrollForwardAndUpdatePositioned, updateTuple, updateTuplePositioned, verifyTupleassertCallError, assertCheckTable, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, emptyStatementCache, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, tearDown, usingDB2Client, usingDerbyNetClient, usingEmbeddedalarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isJava8, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemProperty, sleep, sleepAtLeastOneTick, traceitassertEquals, 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, setUp, toStringpublic void testConcurrencyModeWarning1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testConcurrencyModeWarning2()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testForUpdateException1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testForUpdateException2()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testForwardOnlyReadOnly1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testFailOnUpdateOfReadOnlyResultSet1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testFailOnUpdateOfReadOnlyResultSet2()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testFailOnUpdateOfReadOnlyResultSet3()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testFailOnUpdateOfReadOnlyResultSet4()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testFailOnUpdateOfReadOnlyResultSet5()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testCursorStateAfterCommit1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testCursorStateAfterCommit2()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testCursorStateAfterCommit3()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testCursorStateAfterCommit4()
throws java.sql.SQLException
java.sql.SQLExceptionprivate void testCursorStateAfterCommit(boolean positioned,
int resultSetType)
throws java.sql.SQLException
positioned - true to use positioned update, otherwise use
ResultSet.updateRow()resultSetType - type of result set (as in ResultSet.getType())java.sql.SQLExceptionpublic void testMultiUpdateRow1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testMultiUpdateRow2()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testCursorOperationConflictWarning1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testCursorOperationConflictWarning2()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testIndexedUpdateCursor1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testIndexedUpdateCursor2()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testInsertRowWithScrollCursor()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testIndexedScrollInsensitiveUpdateCursorWithoutForUpdate1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testIndexedScrollInsensitiveUpdateCursorWithForUpdate1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testPrimaryKeyUpdate1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testOtherPrimaryKeyUpdate1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testOtherAndOwnPrimaryKeyUpdate1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testMultipleKeyUpdates()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSecondaryIndexKeyUpdate1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testOtherSecondaryKeyUpdate1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testScrollInsensitiveReadOnly1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testForwardOnlyConcurUpdatableWithForUpdate1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testForwardOnlyConcurUpdatableWithoutForUpdate1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testPositionedUpdateWithoutForUpdate1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testPositionedUpdateWithForUpdate1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testScrollablePositionedUpdateWithForUpdate1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testScrollInsensitiveConcurUpdatableWithForUpdate1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testScrollInsensitiveConcurUpdatableWithForUpdate2()
throws java.sql.SQLException
java.sql.SQLExceptionprivate void testScrollInsensistiveConurUpdatable3(java.sql.ResultSet rs)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testScrollInsensitiveConcurUpdatableWithForUpdate3()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testScrollInsensitiveConcurUpdatableWithoutForUpdate1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testScrollInsensitiveConcurUpdatableWithoutForUpdate2()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testScrollInsensitiveConcurUpdatableWithoutForUpdate3()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testForUpdateWithColumnList()
throws java.sql.SQLException
java.sql.SQLExceptionprivate void checkDetectabilityCallsOutsideRow(java.sql.ResultSet rs,
java.lang.String state)
rs - An open updatable result set.state - A string describing the illegal state.public void testRowUpdatedAndRowDeleted()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDetectabilityExceptions()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDowngradeToScrollReadOnly()
throws java.sql.SQLException
java.sql.SQLExceptionprivate final java.lang.String getNextCursorName()
public static junit.framework.Test suite()
private static junit.framework.Test baseSuite(java.lang.String name)
Apache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.