public class SQLSessionContextTest extends BaseJDBCTestCase
| Modifier and Type | Field and Description |
|---|---|
private java.sql.Connection |
_conn |
private java.sql.Statement |
_stm |
private static java.lang.String[] |
currentPrefix
SQL prefix used to retrieve current value of a session context
state variable.
|
private static java.lang.String |
pwSuffix |
private static java.lang.String |
userException
SQL states used by test
|
private static java.lang.String[] |
users
The TestConfiguration.sqlAuthorizationDecorator decorator presumes
TEST_DBO as dbo, so add it to set of valid users.
|
private static java.lang.String[] |
variableKeywords
SQL keywords for session context state variables
|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE| Constructor and Description |
|---|
SQLSessionContextTest(java.lang.String name)
Create a new instance of SQLSessionContextTest.
|
| Modifier and Type | Method and Description |
|---|---|
private static void |
assertCurrent(java.lang.String sessionVar,
java.sql.ResultSet rs,
java.lang.String expected) |
static void |
calledNestedFromP2(java.lang.String stateString)
Called from p2 so we get to test with a call stack 3 levels
deep.
|
static void |
dropper()
Test that when a nested routine drops a role/schema, the
current value is correctly reset.
|
static int |
f2()
Utility function used to test that state variables are stacked
correctly in a nested SQL session context.
|
static int |
f22()
Used to test that a parallel (subsequent) function call in the
same statement (called after f2 which changes state) is not
affected by the preceding function (f2) call's changes.
|
static int |
f3()
Utility function used to test that current state is stacked
correctly in a nested SQL session context.
|
static void |
p2(java.sql.ResultSet[] rs1,
java.sql.ResultSet[] rs2)
Utility procedure used to test that current session state is
stacked correctly in a nested SQL session context.
|
private static junit.framework.Test |
positiveSuite(java.lang.String framework)
Construct suite of positive tests
|
protected void |
setUp() |
static junit.framework.Test |
suite()
Construct top level suite in this JUnit test
|
protected void |
tearDown()
Tear down this fixture, sub-classes should call
super.tearDown().
|
void |
testPositive()
Positive tests for SQL session state.
|
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 java.sql.Connection _conn
private java.sql.Statement _stm
private static final java.lang.String pwSuffix
private static final java.lang.String userException
private static final java.lang.String[] users
private static final java.lang.String[] variableKeywords
private static final java.lang.String[] currentPrefix
public SQLSessionContextTest(java.lang.String name)
name - Fixture namepublic static junit.framework.Test suite()
private static junit.framework.Test positiveSuite(java.lang.String framework)
framework - Derby framework indicationpublic void testPositive()
throws java.sql.SQLException
java.sql.SQLExceptionprotected void setUp()
throws java.lang.Exception
setUp in class junit.framework.TestCasejava.lang.Exceptionprotected void tearDown()
throws java.lang.Exception
BaseJDBCTestCasetearDown in class BaseJDBCTestCasejava.lang.Exceptionprivate static void assertCurrent(java.lang.String sessionVar,
java.sql.ResultSet rs,
java.lang.String expected)
throws java.sql.SQLException
java.sql.SQLExceptionpublic static void p2(java.sql.ResultSet[] rs1,
java.sql.ResultSet[] rs2)
throws java.lang.Throwable
java.lang.Throwablepublic static void calledNestedFromP2(java.lang.String stateString)
throws java.sql.SQLException
java.sql.SQLExceptionpublic static int f2()
throws java.sql.SQLException
java.sql.SQLExceptionpublic static int f22()
throws java.sql.SQLException
java.sql.SQLExceptionpublic static int f3()
throws java.sql.SQLException
java.sql.SQLExceptionpublic static void dropper()
throws java.sql.SQLException
java.sql.SQLExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.