public class TestDbMetaData extends BaseJDBCTestCase
Modifier and Type | Field and Description |
---|---|
private static java.lang.Object[][] |
ALL_FUNCTIONS
Expected rows from getFunctions() when all functions match.
|
private static java.lang.Integer |
FUNCTION_NO_TABLE_VALUE |
private static JDBC.GeneratedId |
GENERIC_NAME |
private java.sql.DatabaseMetaData |
meta |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
TestDbMetaData(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
private void |
assertGetFunctionColumnsRs(java.sql.ResultSet rs)
Check that the column names are as expected from
getFunctionColumns().
|
private void |
assertGetFunctionsRs(java.sql.ResultSet rs)
Check that the column names are as expected from getFunctions().
|
private void |
assertGetSchemasRs(java.sql.ResultSet rs)
Check that the column names are as expected from getSchemas().
|
private static junit.framework.Test |
baseSuite(java.lang.String name) |
private static void |
createFunctions(java.sql.Statement s) |
private static java.lang.Object[][] |
getGetFunctions()
From the list of all functions extract the ones with GET in the name.
|
private static java.lang.Object[][] |
getSysFunctions()
From the list of all functions extract the ones in schemas
starting with SYS.
|
protected void |
setUp() |
static junit.framework.Test |
suite() |
protected void |
tearDown()
Tear down this fixture, sub-classes should call
super.tearDown().
|
void |
testAutoCommitFailure()
Test autoCommitFailureClosesAllResultSets() by checking whether
a failure in auto-commit mode will close all result sets, even
holdable ones.
|
void |
testAutoCommitFailureClosesAllResultSets() |
void |
testFunctionNullable()
Since JDBC40Translation cannot be accessed in queries in
metadata.properties, the query has to use
DatabaseMetaData.procedureNullable.
|
void |
testGetClientInfoProperties() |
void |
testGetFunctionColumnsForDummyFunctions() |
void |
testGetFunctionColumnsStartingWithDUMMY() |
void |
testGetFunctionsContainingGET() |
void |
testGetFunctionsDummySchema() |
void |
testGetFunctionsFromSysSchemas() |
void |
testGetFunctionsNoSchemaNoCatalog() |
void |
testGetFunctionsNullNullNull() |
void |
testGetSchemasMatchingAPP() |
void |
testGetSchemasMatchingBLAH() |
void |
testGetSchemasNullNull() |
void |
testGetSchemasStartingWithSYS() |
void |
testGetWrapperNegative() |
void |
testGetWrapperPositive() |
void |
testIsWrapperForNegative() |
void |
testIsWrapperForPositive() |
void |
testStoredProcEscapeSyntax()
Test supportsStoredFunctionsUsingCallSyntax() by checking
whether calling a stored procedure using the escape syntax
succeeds.
|
void |
testSupportsStoredFunctionsUsingCallSyntax() |
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 static final java.lang.Integer FUNCTION_NO_TABLE_VALUE
private java.sql.DatabaseMetaData meta
private static final JDBC.GeneratedId GENERIC_NAME
private static final java.lang.Object[][] ALL_FUNCTIONS
protected void setUp() throws java.sql.SQLException
setUp
in class junit.framework.TestCase
java.sql.SQLException
protected void tearDown() throws java.lang.Exception
BaseJDBCTestCase
tearDown
in class BaseJDBCTestCase
java.lang.Exception
private static void createFunctions(java.sql.Statement s) throws java.sql.SQLException
java.sql.SQLException
private static junit.framework.Test baseSuite(java.lang.String name)
public static junit.framework.Test suite()
public void testSupportsStoredFunctionsUsingCallSyntax() throws java.sql.SQLException
java.sql.SQLException
public void testAutoCommitFailureClosesAllResultSets() throws java.sql.SQLException
java.sql.SQLException
public void testGetClientInfoProperties() throws java.sql.SQLException
java.sql.SQLException
public void testFunctionNullable()
private void assertGetFunctionsRs(java.sql.ResultSet rs) throws java.sql.SQLException
java.sql.SQLException
public void testGetFunctionsNullNullNull() throws java.sql.SQLException
java.sql.SQLException
public void testGetFunctionsDummySchema() throws java.sql.SQLException
java.sql.SQLException
public void testGetFunctionsFromSysSchemas() throws java.sql.SQLException
java.sql.SQLException
private static java.lang.Object[][] getSysFunctions()
private static java.lang.Object[][] getGetFunctions()
public void testGetFunctionsContainingGET() throws java.sql.SQLException
java.sql.SQLException
public void testGetFunctionsNoSchemaNoCatalog() throws java.sql.SQLException
java.sql.SQLException
private void assertGetFunctionColumnsRs(java.sql.ResultSet rs) throws java.sql.SQLException
java.sql.SQLException
public void testGetFunctionColumnsStartingWithDUMMY() throws java.sql.SQLException
java.sql.SQLException
public void testGetFunctionColumnsForDummyFunctions() throws java.sql.SQLException
java.sql.SQLException
private void assertGetSchemasRs(java.sql.ResultSet rs) throws java.sql.SQLException
java.sql.SQLException
public void testGetSchemasNullNull() throws java.sql.SQLException
java.sql.SQLException
public void testGetSchemasStartingWithSYS() throws java.sql.SQLException
java.sql.SQLException
public void testGetSchemasMatchingAPP() throws java.sql.SQLException
java.sql.SQLException
public void testGetSchemasMatchingBLAH() throws java.sql.SQLException
java.sql.SQLException
public void testStoredProcEscapeSyntax() throws java.sql.SQLException
java.sql.SQLException
- if an unexpected database error occurspublic void testAutoCommitFailure() throws java.sql.SQLException
java.sql.SQLException
- if an unexpected database error occurspublic void testIsWrapperForPositive() throws java.sql.SQLException
java.sql.SQLException
public void testIsWrapperForNegative() throws java.sql.SQLException
java.sql.SQLException
public void testGetWrapperPositive() throws java.sql.SQLException
java.sql.SQLException
public void testGetWrapperNegative()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.