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, 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 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.SQLException
protected void setUp() throws java.lang.Exception
setUp
in class junit.framework.TestCase
java.lang.Exception
protected void tearDown() throws java.lang.Exception
BaseJDBCTestCase
tearDown
in class BaseJDBCTestCase
java.lang.Exception
private static void assertCurrent(java.lang.String sessionVar, java.sql.ResultSet rs, java.lang.String expected) throws java.sql.SQLException
java.sql.SQLException
public static void p2(java.sql.ResultSet[] rs1, java.sql.ResultSet[] rs2) throws java.lang.Throwable
java.lang.Throwable
public static void calledNestedFromP2(java.lang.String stateString) throws java.sql.SQLException
java.sql.SQLException
public static int f2() throws java.sql.SQLException
java.sql.SQLException
public static int f22() throws java.sql.SQLException
java.sql.SQLException
public static int f3() throws java.sql.SQLException
java.sql.SQLException
public static void dropper() throws java.sql.SQLException
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.