public class DataSourceTest extends BaseJDBCTestCase
SecurityCheck| Modifier and Type | Field and Description |
|---|---|
protected static java.util.Hashtable |
conns
A hashtable of opened connections.
|
private static java.lang.String |
CONNSTRING_FORMAT
The expected format of a connection string.
|
private static java.lang.String |
dbName |
private java.lang.Object |
nogc
Hang onto the SecurityCheck class while running the
tests so that it is not garbage collected during the
test and lose the information it has collected,
in case it should get printed out.
|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE| Constructor and Description |
|---|
DataSourceTest(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
private void |
assertConnectionOK(java.lang.Object[] expectedValues,
java.lang.String dsName,
java.sql.Connection conn) |
private void |
assertConnectionPreClose(java.lang.String dsName,
java.sql.Connection conn) |
private static void |
assertMessageText(java.sql.Connection conn,
java.lang.String retrieveMessageTextValue) |
private void |
assertStatementOK(java.lang.String dsName,
java.sql.Connection conn,
java.sql.Statement s) |
private static void |
assertStringFormat(java.sql.Connection conn)
Check the format of the connection string.
|
private static java.lang.String |
assertStringPrefix(java.lang.Object conn)
Make sure the connection string starts with the right prefix, which
is the classname@hashcode.
|
private void |
assertTenConnectionsUnique()
Get connections using getConnection() and make sure
they're unique
|
private static void |
assertToString(java.sql.Connection conn)
Make sure this connection's string is unique (DERBY-243)
|
private static void |
assertToString(javax.sql.DataSource ds)
Check uniqueness of connection strings coming from a
DataSouce
|
private static void |
assertTraceFilesExist()
Check that trace file exists in
|
private static junit.framework.Test |
baseSuite(java.lang.String postfix)
Return a suite of tests that are run with both client and embedded
|
private static void |
clearConnections()
Clear out and close connections in the connections
hashtable.
|
private static void |
dsConnectionRequest(java.lang.String expectedValue,
javax.sql.DataSource ds,
java.lang.String user,
java.lang.String ConnAttr) |
private static void |
dsConnectionRequests(java.lang.String[] expectedValues,
javax.sql.DataSource ds) |
private static void |
dsGetBadConnection(javax.sql.DataSource ds) |
private static junit.framework.Test |
getClientSuite()
Return a suite of tests that are run with client only
|
private static junit.framework.Test |
getEmbeddedSuite(java.lang.String postfix)
Return a suite of tests that are run with embedded only
|
private static void |
setDatabaseProperty(java.lang.String property,
java.lang.String value) |
private void |
subTestDataSourceDescription(javax.sql.DataSource ds)
Utility method for testing setting and fetching the description
property on a data source.
|
static junit.framework.Test |
suite() |
void |
tearDown()
Tear down this fixture, sub-classes should call
super.tearDown().
|
void |
testAllDataSources() |
void |
testBadConnectionAttributeSyntax() |
void |
testClientDSConnectionAttributes()
Check that database name set using setConnectionAttributes is not used
by ClientDataSource.
|
void |
testClientMessageTextConnectionAttribute()
Check that messageText connection attribute functions correctly.
|
void |
testClientTraceFileDSConnectionAttribute()
Check that traceFile connection attribute functions correctly.
|
void |
testDescriptionProperty()
Check that messageText connection attribute functions correctly.
|
void |
testDSRequestAuthentication() |
void |
testJira95ds() |
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, setUp, toStringprivate static final java.lang.String dbName
protected static java.util.Hashtable conns
private static final java.lang.String CONNSTRING_FORMAT
private final java.lang.Object nogc
private static junit.framework.Test baseSuite(java.lang.String postfix)
postfix - suite name postfixprivate static junit.framework.Test getClientSuite()
private static junit.framework.Test getEmbeddedSuite(java.lang.String postfix)
postfix - suite name postfixpublic static junit.framework.Test suite()
public void tearDown()
throws java.lang.Exception
BaseJDBCTestCasetearDown in class BaseJDBCTestCasejava.lang.Exceptionpublic void testAllDataSources()
throws java.sql.SQLException,
java.lang.Exception
java.sql.SQLExceptionjava.lang.Exceptionpublic void testJira95ds()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testBadConnectionAttributeSyntax()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testClientDSConnectionAttributes()
throws java.lang.Exception
java.sql.SQLExceptionjava.lang.Exceptionpublic void testDSRequestAuthentication()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testClientTraceFileDSConnectionAttribute()
throws java.sql.SQLException
java.sql.SQLExceptionprivate static void dsGetBadConnection(javax.sql.DataSource ds)
private static void assertTraceFilesExist()
public void testClientMessageTextConnectionAttribute()
throws java.lang.Exception
java.sql.SQLExceptionjava.lang.Exceptionprivate static void assertMessageText(java.sql.Connection conn,
java.lang.String retrieveMessageTextValue)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDescriptionProperty()
throws java.sql.SQLException,
java.lang.Exception
java.sql.SQLExceptionjava.lang.Exceptionprivate void subTestDataSourceDescription(javax.sql.DataSource ds)
throws java.lang.Exception
java.lang.Exceptionprivate static void setDatabaseProperty(java.lang.String property,
java.lang.String value)
throws java.sql.SQLException
java.sql.SQLExceptionprivate static void dsConnectionRequests(java.lang.String[] expectedValues,
javax.sql.DataSource ds)
private static void dsConnectionRequest(java.lang.String expectedValue,
javax.sql.DataSource ds,
java.lang.String user,
java.lang.String ConnAttr)
private void assertConnectionOK(java.lang.Object[] expectedValues,
java.lang.String dsName,
java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLExceptionprivate void assertConnectionPreClose(java.lang.String dsName,
java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLExceptionprivate void assertStatementOK(java.lang.String dsName,
java.sql.Connection conn,
java.sql.Statement s)
throws java.sql.SQLException
java.sql.SQLExceptionprivate static void assertToString(java.sql.Connection conn)
throws java.lang.Exception
java.lang.Exceptionprivate static void assertStringFormat(java.sql.Connection conn)
private static java.lang.String assertStringPrefix(java.lang.Object conn)
private static void assertToString(javax.sql.DataSource ds)
throws java.lang.Exception
java.lang.Exceptionprivate static void clearConnections()
throws java.sql.SQLException
java.sql.SQLExceptionprivate void assertTenConnectionsUnique()
throws java.lang.Exception
java.lang.ExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.