public class ConnectionTest extends BaseJDBCTestCase
BaseJDBCTestCase.getConnection()-method returns.
Currently, the property derbyTesting.xa.single can be set to
true to test the XA connection object, which happens to be the
same as the one used for poooled connections.
The connection returned also depends on which framework is being used.DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE| Constructor and Description |
|---|
ConnectionTest(java.lang.String name)
Create a test with the given name.
|
| Modifier and Type | Method and Description |
|---|---|
private static junit.framework.TestSuite |
clientSuite(java.lang.String name)
Create suite containing client-only tests.
|
void |
embeddedCreateBlob()
Tests the Embedded implementation for the createBlob method.
|
void |
embeddedCreateClob()
Tests the Embedded implementation for the createClob method.
|
private static junit.framework.TestSuite |
embeddedSuite(java.lang.String name)
Create suite containing embedded-only tests.
|
static junit.framework.Test |
suite()
Create a test suite containing tests for a JDB connection.
|
void |
testCreateArrayNotImplemented() |
void |
testCreateNClobNotImplemented() |
void |
testCreateSQLXMLNotImplemented() |
void |
testCreateStructNotImplemented() |
void |
testGetClientInfo() |
void |
testGetClientInfoString() |
void |
testGetTypeMapReturnsAsExpected()
Tests that
getTypeMap() returns the input map |
void |
testGetTypeMapReturnsEmptyMap()
Tests that
getTypeMap() returns an empty map when
no type map has been installed. |
void |
testIsValidImplemented()
Tests that
isValid is implemented and returns true
for the connection. |
void |
testIsWrapperReturnsFalse() |
void |
testIsWrapperReturnsTrue() |
void |
testSetClientInfoProperties() |
void |
testSetClientInfoString() |
void |
testUnwrapInvalid() |
void |
testUnwrapValid() |
void |
xtestIsValidWithTimeout()
Tests that
isValid times out when expected. |
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, tearDown, 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, toStringpublic ConnectionTest(java.lang.String name)
name - name of the test.public void embeddedCreateBlob()
throws java.sql.SQLException
java.sql.SQLException - upon failure in the createBlob or the length
methods.public void embeddedCreateClob()
throws java.sql.SQLException
java.sql.SQLException - upon failure in the createClob or the length
methods.public void testCreateArrayNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testCreateNClobNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testCreateSQLXMLNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testCreateStructNotImplemented()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testGetClientInfo()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testGetClientInfoString()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testIsValidImplemented()
throws java.sql.SQLException
isValid is implemented and returns true
for the connection. This test is very limited but is tested
for all connection types. A more complete test of isValid is
found in the ConnectionMethodsTest.java test that is run for
embedded and network client connections.java.sql.SQLExceptionpublic void xtestIsValidWithTimeout()
throws java.sql.SQLException
isValid times out when expected.
This test will need a modification to the source code;
activate the commented out Thread.sleep(2000) (2 seconds) in
DRDAConnThread.ProcessCommands, case CodePoint.OPNQRY
To activate the test, remove the extra 'x' before buildingjava.sql.SQLExceptionpublic void testGetTypeMapReturnsEmptyMap()
throws java.sql.SQLException
getTypeMap() returns an empty map when
no type map has been installed.java.sql.SQLException - if an error occurspublic void testGetTypeMapReturnsAsExpected()
throws java.sql.SQLException
getTypeMap() returns the input mapjava.sql.SQLException - if an error occurspublic void testIsWrapperReturnsFalse()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testIsWrapperReturnsTrue()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSetClientInfoProperties()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSetClientInfoString()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUnwrapValid()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUnwrapInvalid()
throws java.sql.SQLException
java.sql.SQLExceptionprivate static junit.framework.TestSuite clientSuite(java.lang.String name)
private static junit.framework.TestSuite embeddedSuite(java.lang.String name)
public static junit.framework.Test suite()
Apache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.