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 TestSuite 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, 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, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, 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, toStringprivate static IsoLevel[] isoLevels
private static int isolationIndex
public static junit.framework.Test suite()
private static junit.framework.Test baseSuite(java.lang.String name)
name - TestSuite namepublic void setUp()
throws java.sql.SQLException
setUp in class junit.framework.TestCasejava.sql.SQLExceptionpublic void tearDown()
throws java.lang.Exception
tearDown in class BaseJDBCTestCasejava.lang.Exceptionpublic static void setIsolationJDBC(int isolation)
throws java.sql.SQLException
isolation - JDBC isolation level constant representing the
new isolation leveljava.sql.SQLExceptionpublic static void setIsolationSQL(java.lang.String sqlName)
throws java.sql.SQLException
sqlName - SQL string representing the new isolation leveljava.sql.SQLExceptionpublic static int getTransactionIsolationJDBC()
throws java.sql.SQLException
java.sql.SQLExceptionpublic static int getCycleIsolationJDBC()
throws java.sql.SQLException
java.sql.SQLExceptionpublic static java.lang.String getCycleIsolationSQL()
throws java.sql.SQLException
java.sql.SQLExceptionpublic static void setSchema(java.lang.String schemaName)
throws java.sql.SQLException
schemaName - name of the new schemajava.sql.SQLExceptionpublic static java.lang.String getSchemaTransition(java.lang.String nextSchema)
throws java.sql.SQLException
nextSchema - schema to transition tojava.sql.SQLExceptionprivate static IsoLevel cycleIsolation()
private void verifyCachedIsolation(java.sql.Connection c)
throws java.sql.SQLException
c - Connection to checkjava.sql.SQLExceptionprivate void verifyCachedSchema(java.sql.Connection c)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testChangeIsoLevelStatementSQL()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testChangeIsoLevelPreparedStatementSQL()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testChangeIsoLevelFunctionJDBC()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testChangeIsoLevelFunctionSQL()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testChangeIsoLevelPreparedFunctionJDBC()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testChangeIsoLevelPreparedFunctionSQL()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testChangeIsoLevelProcedureJDBC()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testChangeIsoLevelProcedureSQL()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testChangeIsoLevelCallableStatementJDBC()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testChangeIsoLevelCallableStatementSQL()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testChangeIsoLevelSQLInBatch()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testChangeIsoLevelProcedureJdbcBatch()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testChangeIsoLevelProcedureSqlBatch()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testChangeIsoLevelProcedureJdbcCallableBatch()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testChangeIsoLevelProcedureSqlCallableBatch()
throws java.sql.SQLException
java.sql.SQLExceptionprivate 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.SQLExceptionprivate 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.SQLExceptionpublic void testSmallForwardOnlyReadOnly()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSmallScrollInsensitiveReadOnly()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSmallScrollSensitiveReadOnly()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSmallForwardOnlyUpdatable()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSmallScrollInsensitiveUpdatable()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSmallScrollSensitiveUpdatable()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSmallPreparedForwardOnlyReadOnly()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSmallPreparedScrollSensitiveReadOnly()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSmallPreparedScrollInsensitiveReadOnly()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSmallPreparedForwardOnlyUpdatable()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSmallPreparedScrollSensitiveUpdatable()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSmallPreparedScrollInsensitiveUpdatable()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testLargeForwardOnlyReadOnly()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testLargeScrollSensitiveReadOnly()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testLargeScrollInsensitiveReadOnly()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testLargeForwardOnlyUpdatable()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testLargeScrollSensitiveUpdatable()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testLargeScrollInsensitiveUpdatable()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testLargePreparedForwardOnlyReadOnly()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testLargePreparedScrollSensitiveReadOnly()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testLargePreparedScrollInsensitiveReadOnly()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testLargePreparedForwardOnlyUpdatable()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testLargePreparedScrollSensitiveUpdatable()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testLargePreparedScrollInsensitiveUpdatable()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSetSchema()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testPreparedSetSchema()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSetSchemaProcedure()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testPreparedSetSchemaProcedure()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSetSchemaFunction()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testPreparedSetSchemaFunction()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSetSchemaFunctionLarge()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testPreparedSetSchemaFunctionLarge()
throws java.sql.SQLException
java.sql.SQLExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.