|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.derbyTesting.junit.BaseTestCase
org.apache.derbyTesting.junit.BaseJDBCTestCase
org.apache.derbyTesting.functionTests.tests.jdbcapi.CacheSessionDataTest
public class CacheSessionDataTest
This is a test for DERBY-3192 (https://issues.apache.org/jira/browse/DERBY-3192) which tries to avoid unecessary roundtrips by piggybacking session information on the messages going back to the client. The goal is that whenever a user requests session information from the client driver, the correct information should already be available and no special roundtrip be required. So far the test only checks caching of the isolation level, but other session attributes can be added later. The test attempts to "fool" the caching mechanism by modifying the isolation level without going through the client's Connection.setTransactionIsolation method. The effect of modifying the isolation level in and out of XA transactions is covered by the XA tests and not tested here.
| Field Summary | |
|---|---|
private static int |
isolationIndex
|
private static IsoLevel[] |
isoLevels
|
| Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase |
|---|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE |
| Constructor Summary | |
|---|---|
CacheSessionDataTest(java.lang.String name)
|
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class org.apache.derbyTesting.junit.BaseTestCase |
|---|
alarm, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertSecurityManager, assertThrowableEquals, execJavaCmd, fail, getFailureFolder, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeSystemProperty, runBare, setSystemProperty, traceit |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runTest, setName, toString |
| Methods inherited from class junit.framework.Assert |
|---|
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, fail, fail |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static IsoLevel[] isoLevels
private static int isolationIndex
| Constructor Detail |
|---|
public CacheSessionDataTest(java.lang.String name)
| Method Detail |
|---|
public static junit.framework.Test suite()
private static junit.framework.Test baseSuite(java.lang.String name)
name - TestSuite name
public void setUp()
throws java.sql.SQLException
setUp in class junit.framework.TestCasejava.sql.SQLException
public void tearDown()
throws java.lang.Exception
tearDown in class BaseJDBCTestCasejava.lang.Exception
public static void setIsolationJDBC(int isolation)
throws java.sql.SQLException
isolation - JDBC isolation level constant representing the
new isolation level
java.sql.SQLException
public static void setIsolationSQL(java.lang.String sqlName)
throws java.sql.SQLException
sqlName - SQL string representing the new isolation level
java.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 schema
java.sql.SQLException
public static java.lang.String getSchemaTransition(java.lang.String nextSchema)
throws java.sql.SQLException
nextSchema - schema to transition to
java.sql.SQLExceptionprivate static IsoLevel cycleIsolation()
private void verifyCachedIsolation(java.sql.Connection c)
throws java.sql.SQLException
c - Connection to check
java.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 ResultSet
java.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 ResultSet
java.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
|
Built on Wed 2009-11-25 18:43:31-0800, from revision 884373 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||