public class CacheSessionDataTest extends BaseJDBCTestCase
Modifier and Type | Field and Description |
---|---|
private static int |
isolationIndex |
private static IsoLevel[] |
isoLevels |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
CacheSessionDataTest(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
private static junit.framework.Test |
baseSuite(java.lang.String name)
Creates a new BaseTestSuite with all the tests, and wraps it in a
CleanDatabaseSetup with a custom decorator.
|
private void |
cursorTest(java.lang.String table,
int type,
int concur)
Utility method for testing Statements that return different
types of ResultSets to check that piggybacking doesn't cause problems.
|
private static IsoLevel |
cycleIsolation()
Utility that cycles through the legal isolation levels in the following
order: read uncommitted -> read committed -> repeatable read ->
serializable -> read uncommitted -> ...
|
static int |
getCycleIsolationJDBC()
Implementation of the SQL function GET_CYCLE_ISOLATION_JDBC.
|
static java.lang.String |
getCycleIsolationSQL()
Implementation of the SQL function GET_CYCLE_ISOLATION_SQL.
|
static java.lang.String |
getSchemaTransition(java.lang.String nextSchema)
Implementation of the SQL function GET_SCHEMA_TRANSITION.
|
static int |
getTransactionIsolationJDBC()
Implementation of the SQL function GET_TRANSACTION_ISOLATION_JDBC.
|
private void |
preparedCursorTest(java.lang.String table,
int type,
int concur)
Utility method for testing PreparedStatements that return different
types of ResultSets to check that piggybacking doesn't cause problems.
|
static void |
setIsolationJDBC(int isolation)
Implementation of the stored procedure SET_ISOLATION_JDBC.
|
static void |
setIsolationSQL(java.lang.String sqlName)
Implementation of the SQL function SET_ISOLATION_SQL.
|
static void |
setSchema(java.lang.String schemaName)
Implementation of the SQL procedure SET_SCHEMA.
|
void |
setUp()
Turns off auto commit on the default connection and verifies that the
isolation level is read committed.
|
static junit.framework.Test |
suite()
Adds both the embedded and client-server versions of the baseSuite to
the Test.
|
void |
tearDown()
Removes all tables in schema APP which has the prefix 'T', before calling
super.tearDown().
|
void |
testChangeIsoLevelCallableStatementJDBC() |
void |
testChangeIsoLevelCallableStatementSQL() |
void |
testChangeIsoLevelFunctionJDBC() |
void |
testChangeIsoLevelFunctionSQL() |
void |
testChangeIsoLevelPreparedFunctionJDBC() |
void |
testChangeIsoLevelPreparedFunctionSQL() |
void |
testChangeIsoLevelPreparedStatementSQL() |
void |
testChangeIsoLevelProcedureJDBC() |
void |
testChangeIsoLevelProcedureJdbcBatch() |
void |
testChangeIsoLevelProcedureJdbcCallableBatch() |
void |
testChangeIsoLevelProcedureSQL() |
void |
testChangeIsoLevelProcedureSqlBatch() |
void |
testChangeIsoLevelProcedureSqlCallableBatch() |
void |
testChangeIsoLevelSQLInBatch() |
void |
testChangeIsoLevelStatementSQL() |
void |
testLargeForwardOnlyReadOnly() |
void |
testLargeForwardOnlyUpdatable() |
void |
testLargePreparedForwardOnlyReadOnly() |
void |
testLargePreparedForwardOnlyUpdatable() |
void |
testLargePreparedScrollInsensitiveReadOnly() |
void |
testLargePreparedScrollInsensitiveUpdatable() |
void |
testLargePreparedScrollSensitiveReadOnly() |
void |
testLargePreparedScrollSensitiveUpdatable() |
void |
testLargeScrollInsensitiveReadOnly() |
void |
testLargeScrollInsensitiveUpdatable() |
void |
testLargeScrollSensitiveReadOnly() |
void |
testLargeScrollSensitiveUpdatable() |
void |
testPreparedSetSchema() |
void |
testPreparedSetSchemaFunction() |
void |
testPreparedSetSchemaFunctionLarge() |
void |
testPreparedSetSchemaProcedure() |
void |
testSetSchema() |
void |
testSetSchemaFunction() |
void |
testSetSchemaFunctionLarge() |
void |
testSetSchemaProcedure() |
void |
testSmallForwardOnlyReadOnly() |
void |
testSmallForwardOnlyUpdatable() |
void |
testSmallPreparedForwardOnlyReadOnly() |
void |
testSmallPreparedForwardOnlyUpdatable() |
void |
testSmallPreparedScrollInsensitiveReadOnly() |
void |
testSmallPreparedScrollInsensitiveUpdatable() |
void |
testSmallPreparedScrollSensitiveReadOnly() |
void |
testSmallPreparedScrollSensitiveUpdatable() |
void |
testSmallScrollInsensitiveReadOnly() |
void |
testSmallScrollInsensitiveUpdatable() |
void |
testSmallScrollSensitiveReadOnly() |
void |
testSmallScrollSensitiveUpdatable() |
private void |
verifyCachedIsolation(java.sql.Connection c)
Utility that verifies that the isolation level reported by the client
is the same as evaluating 'VALUES CURRENT ISOLATION' and getting the
isolation level from the EmbedConnection on the server.
|
private void |
verifyCachedSchema(java.sql.Connection c) |
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 IsoLevel[] isoLevels
private static int isolationIndex
public static junit.framework.Test suite()
private static junit.framework.Test baseSuite(java.lang.String name)
name
- BaseTestSuite namepublic void setUp() throws java.sql.SQLException
setUp
in class junit.framework.TestCase
java.sql.SQLException
public void tearDown() throws java.lang.Exception
tearDown
in class BaseJDBCTestCase
java.lang.Exception
public static void setIsolationJDBC(int isolation) throws java.sql.SQLException
isolation
- JDBC isolation level constant representing the
new isolation leveljava.sql.SQLException
public static void setIsolationSQL(java.lang.String sqlName) throws java.sql.SQLException
sqlName
- SQL string representing the new isolation leveljava.sql.SQLException
public static int getTransactionIsolationJDBC() throws java.sql.SQLException
java.sql.SQLException
public static int getCycleIsolationJDBC() throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String getCycleIsolationSQL() throws java.sql.SQLException
java.sql.SQLException
public static void setSchema(java.lang.String schemaName) throws java.sql.SQLException
schemaName
- name of the new schemajava.sql.SQLException
public static java.lang.String getSchemaTransition(java.lang.String nextSchema) throws java.sql.SQLException
nextSchema
- schema to transition tojava.sql.SQLException
private static IsoLevel cycleIsolation()
private void verifyCachedIsolation(java.sql.Connection c) throws java.sql.SQLException
c
- Connection to checkjava.sql.SQLException
private void verifyCachedSchema(java.sql.Connection c) throws java.sql.SQLException
java.sql.SQLException
public void testChangeIsoLevelStatementSQL() throws java.sql.SQLException
java.sql.SQLException
public void testChangeIsoLevelPreparedStatementSQL() throws java.sql.SQLException
java.sql.SQLException
public void testChangeIsoLevelFunctionJDBC() throws java.sql.SQLException
java.sql.SQLException
public void testChangeIsoLevelFunctionSQL() throws java.sql.SQLException
java.sql.SQLException
public void testChangeIsoLevelPreparedFunctionJDBC() throws java.sql.SQLException
java.sql.SQLException
public void testChangeIsoLevelPreparedFunctionSQL() throws java.sql.SQLException
java.sql.SQLException
public void testChangeIsoLevelProcedureJDBC() throws java.sql.SQLException
java.sql.SQLException
public void testChangeIsoLevelProcedureSQL() throws java.sql.SQLException
java.sql.SQLException
public void testChangeIsoLevelCallableStatementJDBC() throws java.sql.SQLException
java.sql.SQLException
public void testChangeIsoLevelCallableStatementSQL() throws java.sql.SQLException
java.sql.SQLException
public void testChangeIsoLevelSQLInBatch() throws java.sql.SQLException
java.sql.SQLException
public void testChangeIsoLevelProcedureJdbcBatch() throws java.sql.SQLException
java.sql.SQLException
public void testChangeIsoLevelProcedureSqlBatch() throws java.sql.SQLException
java.sql.SQLException
public void testChangeIsoLevelProcedureJdbcCallableBatch() throws java.sql.SQLException
java.sql.SQLException
public void testChangeIsoLevelProcedureSqlCallableBatch() throws java.sql.SQLException
java.sql.SQLException
private void cursorTest(java.lang.String table, int type, int concur) throws java.sql.SQLException
table
- table to select fromtype
- type of ResultSetconcur
- concurrency of ResultSetjava.sql.SQLException
private void preparedCursorTest(java.lang.String table, int type, int concur) throws java.sql.SQLException
table
- table to select fromtype
- type of ResultSetconcur
- concurrency of ResultSetjava.sql.SQLException
public void testSmallForwardOnlyReadOnly() throws java.sql.SQLException
java.sql.SQLException
public void testSmallScrollInsensitiveReadOnly() throws java.sql.SQLException
java.sql.SQLException
public void testSmallScrollSensitiveReadOnly() throws java.sql.SQLException
java.sql.SQLException
public void testSmallForwardOnlyUpdatable() throws java.sql.SQLException
java.sql.SQLException
public void testSmallScrollInsensitiveUpdatable() throws java.sql.SQLException
java.sql.SQLException
public void testSmallScrollSensitiveUpdatable() throws java.sql.SQLException
java.sql.SQLException
public void testSmallPreparedForwardOnlyReadOnly() throws java.sql.SQLException
java.sql.SQLException
public void testSmallPreparedScrollSensitiveReadOnly() throws java.sql.SQLException
java.sql.SQLException
public void testSmallPreparedScrollInsensitiveReadOnly() throws java.sql.SQLException
java.sql.SQLException
public void testSmallPreparedForwardOnlyUpdatable() throws java.sql.SQLException
java.sql.SQLException
public void testSmallPreparedScrollSensitiveUpdatable() throws java.sql.SQLException
java.sql.SQLException
public void testSmallPreparedScrollInsensitiveUpdatable() throws java.sql.SQLException
java.sql.SQLException
public void testLargeForwardOnlyReadOnly() throws java.sql.SQLException
java.sql.SQLException
public void testLargeScrollSensitiveReadOnly() throws java.sql.SQLException
java.sql.SQLException
public void testLargeScrollInsensitiveReadOnly() throws java.sql.SQLException
java.sql.SQLException
public void testLargeForwardOnlyUpdatable() throws java.sql.SQLException
java.sql.SQLException
public void testLargeScrollSensitiveUpdatable() throws java.sql.SQLException
java.sql.SQLException
public void testLargeScrollInsensitiveUpdatable() throws java.sql.SQLException
java.sql.SQLException
public void testLargePreparedForwardOnlyReadOnly() throws java.sql.SQLException
java.sql.SQLException
public void testLargePreparedScrollSensitiveReadOnly() throws java.sql.SQLException
java.sql.SQLException
public void testLargePreparedScrollInsensitiveReadOnly() throws java.sql.SQLException
java.sql.SQLException
public void testLargePreparedForwardOnlyUpdatable() throws java.sql.SQLException
java.sql.SQLException
public void testLargePreparedScrollSensitiveUpdatable() throws java.sql.SQLException
java.sql.SQLException
public void testLargePreparedScrollInsensitiveUpdatable() throws java.sql.SQLException
java.sql.SQLException
public void testSetSchema() throws java.sql.SQLException
java.sql.SQLException
public void testPreparedSetSchema() throws java.sql.SQLException
java.sql.SQLException
public void testSetSchemaProcedure() throws java.sql.SQLException
java.sql.SQLException
public void testPreparedSetSchemaProcedure() throws java.sql.SQLException
java.sql.SQLException
public void testSetSchemaFunction() throws java.sql.SQLException
java.sql.SQLException
public void testPreparedSetSchemaFunction() throws java.sql.SQLException
java.sql.SQLException
public void testSetSchemaFunctionLarge() throws java.sql.SQLException
java.sql.SQLException
public void testPreparedSetSchemaFunctionLarge() throws java.sql.SQLException
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.