public class HoldCursorTest extends BaseJDBCTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
HoldCursorTest(java.lang.String name)
Public constructor required for running test as standalone JUnit.
|
Modifier and Type | Method and Description |
---|---|
static void |
assertGetIntEquals(int position,
int expected,
java.sql.ResultSet rs)
Perform getInt(position) with expected error
|
void |
assertIsolationError(java.lang.String sqlState,
int level)
Assert that the changing isolation throws
an SQLException with the expected state.
|
private static junit.framework.Test |
baseSuite(boolean embeddedMode) |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Utility method to create a Statement using the connection
returned by getConnection.
|
void |
setHoldability(int holdability)
Utility method to set Holdability
|
void |
setTransactionIsolation(int level)
Utility method to set Transaction Isolation
|
protected void |
setUp()
Set the fixture up with tables and insert rows .
|
void |
StatementsInProcedure(int holdability)
test holdability of statements in procedures
|
void |
StatementsInProcedureTest() |
static junit.framework.Test |
suite()
Create a suite of tests.
|
protected void |
tearDown()
Drop tables for clean up
|
void |
testCloseCursor()
Test for drop table after closing the cursor
|
void |
testDropTable()
Test that drop table cannot be performed when there is an open
cursor on that table.
|
void |
testHoldabilityOverCommit()
set connection holdability and test holdability of statements inside and outside procedures
test that holdability of statements always overrides holdability of connection
|
void |
testHoldCursorOnMultiTableQuery()
test cursor holdability after commit on multi table query
|
void |
testIsolationLevelChange()
Test Chaging isolation levels with and without held curosors
|
static void |
testProc(java.sql.ResultSet[] rs1,
java.sql.ResultSet[] rs2)
Java method for stored procedure
|
void |
testStatements(int holdability)
test holdability of statements outside procedures
|
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, 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
public HoldCursorTest(java.lang.String name)
public static junit.framework.Test suite()
private static junit.framework.Test baseSuite(boolean embeddedMode)
protected void setUp() throws java.sql.SQLException
setUp
in class junit.framework.TestCase
java.sql.SQLException
protected void tearDown() throws java.lang.Exception
tearDown
in class BaseJDBCTestCase
java.lang.Exception
public void testHoldCursorOnMultiTableQuery() throws java.lang.Exception
java.lang.Exception
public void testIsolationLevelChange() throws java.lang.Exception
java.lang.Exception
public void testDropTable() throws java.sql.SQLException
java.sql.SQLException
public void testHoldabilityOverCommit() throws java.sql.SQLException
java.sql.SQLException
public void StatementsInProcedureTest() throws java.sql.SQLException
java.sql.SQLException
public void testStatements(int holdability) throws java.sql.SQLException
holdability
- java.sql.SQLException
public void StatementsInProcedure(int holdability) throws java.sql.SQLException
holdability
- java.sql.SQLException
public void testCloseCursor() throws java.sql.SQLException
java.sql.SQLException
public void assertIsolationError(java.lang.String sqlState, int level)
sqlState
- level
- public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
createStatement
in class BaseJDBCTestCase
resultSetType
- resultSetConcurrency
- resultSetHoldability
- java.sql.SQLException
public void setTransactionIsolation(int level) throws java.sql.SQLException
level
- java.sql.SQLException
public void setHoldability(int holdability) throws java.sql.SQLException
holdability
- java.sql.SQLException
public static void assertGetIntEquals(int position, int expected, java.sql.ResultSet rs)
position
- expected
- rs
- public static void testProc(java.sql.ResultSet[] rs1, java.sql.ResultSet[] rs2) throws java.lang.Exception
rs1
- rs2
- java.lang.Exception
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.