public class LangProcedureTest extends BaseJDBCTestCase
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
LANG_INVALID_CALL_STATEMENT |
private static java.lang.String |
LANG_STRING_TRUNCATION |
private java.lang.String |
thisClassName |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
LangProcedureTest(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
static void |
ambiguous1(int p1,
java.lang.String p2,
java.sql.ResultSet[] data1) |
static void |
ambiguous1(int p1,
java.lang.String p2,
java.sql.ResultSet[] data1,
java.sql.ResultSet[] data2) |
static void |
ambiguous2(java.lang.Integer p1,
int p2) |
static void |
ambiguous2(int p1,
java.lang.Integer p2) |
private void |
assertUpdateCountForProcedureWithNoResults(java.sql.Statement s) |
static void |
badDynamicParameter(int p1,
ProcedureTest[] data) |
private static void |
checkCommitWithMultipleResultSets(java.sql.CallableStatement drs1,
java.sql.Connection conn2,
java.lang.String action)
Original harness results transcribed here:
-auto commit is true
-lock count before execution 0
-lock count after execution 1
-lock count after next on first rs 3 -> 2 now FIXME: explain
-lock count after first getMoreResults() 2
-lock count after next on second rs 7
-lock count after second getMoreResults() 0
-auto commit is false
-lock count before execution 0
-lock count after execution 1
-lock count after next on first rs 3 -> 2 now FIXME: explain
-lock count after first getMoreResults() 2
-lock count after next on second rs 7
-lock count after second getMoreResults() 7
-auto commit is true
-lock count before execution 0
-lock count after execution 1
-lock count after next on first rs 3 -> 2 now FIXME: explain
-executing statement to force auto commit on open call statement
-lock count after statement execution 0
-lock count after first getMoreResults() 0
-lock count after next on second rs 0
-lock count after second getMoreResults() 0
|
private static void |
checkMatchingProcedures(java.sql.Connection conn,
java.lang.String procedureName,
java.lang.String[] sysAliasDefinition,
java.lang.String[] DBMetaDefinition,
java.lang.String[] columnDefinition) |
static void |
DERBY_3304(java.sql.ResultSet[] rs1)
This procedure does an explicit commit and then creates a resultset
to be passed back to the caller.
|
private static void |
executeStatement(java.sql.Statement s,
java.lang.String sql,
java.lang.String[] result) |
static int |
FUNC(int i) |
static void |
inoutparams2(int[] p1,
int p2) |
static void |
inoutparams3(java.lang.String[] p1,
int p2) |
static void |
inoutparams4(java.math.BigDecimal[] p1,
java.lang.String p2) |
static void |
insertCausingRollback(int p1,
java.lang.String p2,
java.sql.ResultSet[] data)
A test case for DERBY-3304.
|
static void |
insertRow(int p1) |
static void |
insertRow(int p1,
java.lang.String p2) |
static void |
missingDynamicParameter(int p1) |
static void |
missingDynamicParameter(int p1,
java.lang.Object p2) |
static void |
outparams1(int[] p1,
int p2) |
static void |
parameter1(int a,
java.lang.String b,
java.lang.String c,
java.sql.ResultSet[] rs) |
static void |
parameter2(int a,
java.math.BigDecimal b,
java.math.BigDecimal c,
java.sql.ResultSet[] rs) |
(package private) static java.lang.String |
PARAMTYPE(short type) |
static void |
PROC(int[] i) |
static void |
pSMALLINT(short in,
short[] inout,
short[] out) |
static void |
rollbackInsideProc(int p1,
java.sql.ResultSet[] data)
A test case for DERBY-3304.
|
static void |
rollbackInsideProcWith2ResultSets(int p1,
java.sql.ResultSet[] data1,
java.sql.ResultSet[] data2)
A test case for DERBY-3304.
|
static void |
selectRows(int p1,
int p2,
java.sql.ResultSet[] data1,
java.sql.ResultSet[] data2) |
static void |
selectRows(int p1,
java.sql.ResultSet[] data) |
static void |
selectRows(java.lang.String table,
java.sql.ResultSet[] rs) |
static void |
sqlControl(java.lang.String[] e1,
java.lang.String[] e2,
java.lang.String[] e3,
java.lang.String[] e4,
java.lang.String[] e5,
java.lang.String[] e6,
java.lang.String[] e7) |
static void |
sqlControl2(java.lang.String[] e1,
java.lang.String[] e2,
java.lang.String[] e3,
java.lang.String[] e4,
java.lang.String[] e5,
java.lang.String[] e6,
java.lang.String[] e7) |
static void |
sqlControl3(java.lang.String[] e1,
java.lang.String[] e2,
java.lang.String[] e3,
java.lang.String[] e4,
java.lang.String[] e5,
java.lang.String[] e6,
java.lang.String[] e7) |
static void |
sqlControl4(int sqlc,
java.lang.String[] e1,
java.lang.String[] e2,
java.lang.String[] e3,
java.lang.String[] e4,
java.lang.String[] e5,
java.lang.String[] e6,
java.lang.String[] e7,
java.lang.String[] e8) |
static junit.framework.Test |
suite()
Default suite for running this test (embedded and client).
|
protected void |
tearDown()
Tear down this fixture, sub-classes should call
super.tearDown().
|
void |
testAmbigiousMethods() |
void |
testCreateRoutineErrors()
Verifies the exception that gets raised for bad syntax or unsupported
features.
|
void |
testDelayedClassChecking()
Tests the exception that gets thrown at runtime when the external method
for a SQL procedure doesn't exist -- there's no check for existence at
CREATE time, the check occurs at runtime.
|
void |
testDerby5945()
Better diagnostics when a function is being used as a procedure
or vice versa
|
void |
testDuplicates() |
void |
testDynamicResultSets()
1. basic testing 2. correct auto commit logic 3. correct holdability
(JDBC 3)
|
void |
testMethodSignatureDerby258()
Verifies the fix for DERBY-258: incorrect method resolution if an
explicit method signature has Java type that does not match the correct
SQL to Java mapping as defined by JDBC.
|
void |
testOutparams() |
void |
testParameterTypes() |
void |
testResultSetsWithLobs() |
void |
testSQLControl() |
void |
testSqlProcedures() |
void |
testZeroArgProcedures() |
(package private) static java.lang.String |
TYPE(short type) |
static void |
zeroArg() |
static void |
zeroArgDynamicResult(java.sql.ResultSet[] data1,
java.sql.ResultSet[] data2,
java.sql.ResultSet[] data3,
java.sql.ResultSet[] data4) |
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, setUp, toString
private static final java.lang.String LANG_STRING_TRUNCATION
private static final java.lang.String LANG_INVALID_CALL_STATEMENT
private final java.lang.String thisClassName
protected void tearDown() throws java.lang.Exception
BaseJDBCTestCase
tearDown
in class BaseJDBCTestCase
java.lang.Exception
public static junit.framework.Test suite()
public void testCreateRoutineErrors() throws java.sql.SQLException
java.sql.SQLException
public void testMethodSignatureDerby258() throws java.sql.SQLException
java.sql.SQLException
public static void DERBY_3304(java.sql.ResultSet[] rs1) throws java.sql.SQLException
rs1
- java.sql.SQLException
public void testDelayedClassChecking() throws java.sql.SQLException
java.sql.SQLException
public void testDuplicates() throws java.sql.SQLException
java.sql.SQLException
public void testAmbigiousMethods() throws java.sql.SQLException
java.sql.SQLException
private static void checkMatchingProcedures(java.sql.Connection conn, java.lang.String procedureName, java.lang.String[] sysAliasDefinition, java.lang.String[] DBMetaDefinition, java.lang.String[] columnDefinition) throws java.sql.SQLException
java.sql.SQLException
public void testZeroArgProcedures() throws java.sql.SQLException
java.sql.SQLException
public void testSqlProcedures() throws java.sql.SQLException
java.sql.SQLException
public void testDynamicResultSets() throws java.sql.SQLException
java.sql.SQLException
public void testResultSetsWithLobs() throws java.sql.SQLException
java.sql.SQLException
private static void checkCommitWithMultipleResultSets(java.sql.CallableStatement drs1, java.sql.Connection conn2, java.lang.String action) throws java.sql.SQLException
java.sql.SQLException
private void assertUpdateCountForProcedureWithNoResults(java.sql.Statement s) throws java.sql.SQLException
java.sql.SQLException
static java.lang.String TYPE(short type)
static java.lang.String PARAMTYPE(short type)
public static void ambiguous1(int p1, java.lang.String p2, java.sql.ResultSet[] data1, java.sql.ResultSet[] data2)
public static void ambiguous1(int p1, java.lang.String p2, java.sql.ResultSet[] data1)
public static void ambiguous2(int p1, java.lang.Integer p2)
public static void ambiguous2(java.lang.Integer p1, int p2)
public static void zeroArg()
public static void insertRow(int p1) throws java.sql.SQLException
java.sql.SQLException
public static void insertRow(int p1, java.lang.String p2) throws java.sql.SQLException
java.sql.SQLException
public static void selectRows(int p1, java.sql.ResultSet[] data) throws java.sql.SQLException
java.sql.SQLException
public static void rollbackInsideProc(int p1, java.sql.ResultSet[] data) throws java.sql.SQLException
p1
- data
- java.sql.SQLException
public static void rollbackInsideProcWith2ResultSets(int p1, java.sql.ResultSet[] data1, java.sql.ResultSet[] data2) throws java.sql.SQLException
p1
- data1
- data2
- java.sql.SQLException
public static void insertCausingRollback(int p1, java.lang.String p2, java.sql.ResultSet[] data) throws java.sql.SQLException
p1
- p2
- data
- java.sql.SQLException
public static void selectRows(int p1, int p2, java.sql.ResultSet[] data1, java.sql.ResultSet[] data2) throws java.sql.SQLException
java.sql.SQLException
public static void selectRows(java.lang.String table, java.sql.ResultSet[] rs) throws java.sql.SQLException
java.sql.SQLException
public void testParameterTypes() throws java.sql.SQLException
java.sql.SQLException
public void testOutparams() throws java.sql.SQLException
java.sql.SQLException
public void testSQLControl() throws java.sql.SQLException
java.sql.SQLException
public void testDerby5945() throws java.sql.SQLException
java.sql.SQLException
public static void PROC(int[] i)
public static int FUNC(int i)
public static void pSMALLINT(short in, short[] inout, short[] out) throws java.sql.SQLException
java.sql.SQLException
public static void parameter1(int a, java.lang.String b, java.lang.String c, java.sql.ResultSet[] rs) throws java.sql.SQLException
java.sql.SQLException
public static void parameter2(int a, java.math.BigDecimal b, java.math.BigDecimal c, java.sql.ResultSet[] rs) throws java.sql.SQLException
java.sql.SQLException
public static void outparams1(int[] p1, int p2)
public static void inoutparams2(int[] p1, int p2)
public static void inoutparams3(java.lang.String[] p1, int p2)
public static void inoutparams4(java.math.BigDecimal[] p1, java.lang.String p2)
public static void sqlControl(java.lang.String[] e1, java.lang.String[] e2, java.lang.String[] e3, java.lang.String[] e4, java.lang.String[] e5, java.lang.String[] e6, java.lang.String[] e7) throws java.sql.SQLException
java.sql.SQLException
public static void sqlControl2(java.lang.String[] e1, java.lang.String[] e2, java.lang.String[] e3, java.lang.String[] e4, java.lang.String[] e5, java.lang.String[] e6, java.lang.String[] e7) throws java.sql.SQLException
java.sql.SQLException
public static void sqlControl3(java.lang.String[] e1, java.lang.String[] e2, java.lang.String[] e3, java.lang.String[] e4, java.lang.String[] e5, java.lang.String[] e6, java.lang.String[] e7) throws java.sql.SQLException
java.sql.SQLException
public static void sqlControl4(int sqlc, java.lang.String[] e1, java.lang.String[] e2, java.lang.String[] e3, java.lang.String[] e4, java.lang.String[] e5, java.lang.String[] e6, java.lang.String[] e7, java.lang.String[] e8) throws java.sql.SQLException
java.sql.SQLException
private static void executeStatement(java.sql.Statement s, java.lang.String sql, java.lang.String[] result)
public static void missingDynamicParameter(int p1)
public static void missingDynamicParameter(int p1, java.lang.Object p2)
public static void badDynamicParameter(int p1, ProcedureTest[] data)
public static void zeroArgDynamicResult(java.sql.ResultSet[] data1, java.sql.ResultSet[] data2, java.sql.ResultSet[] data3, java.sql.ResultSet[] data4)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.