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 BaseTestSuite |
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 BaseTestSuite |
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, 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, tearDown, 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
public 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.SQLException
public void testCreateNClobNotImplemented() throws java.sql.SQLException
java.sql.SQLException
public void testCreateSQLXMLNotImplemented() throws java.sql.SQLException
java.sql.SQLException
public void testCreateStructNotImplemented() throws java.sql.SQLException
java.sql.SQLException
public void testGetClientInfo() throws java.sql.SQLException
java.sql.SQLException
public void testGetClientInfoString() throws java.sql.SQLException
java.sql.SQLException
public 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.SQLException
public 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.SQLException
public 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.SQLException
public void testIsWrapperReturnsTrue() throws java.sql.SQLException
java.sql.SQLException
public void testSetClientInfoProperties() throws java.sql.SQLException
java.sql.SQLException
public void testSetClientInfoString() throws java.sql.SQLException
java.sql.SQLException
public void testUnwrapValid() throws java.sql.SQLException
java.sql.SQLException
public void testUnwrapInvalid() throws java.sql.SQLException
java.sql.SQLException
private static BaseTestSuite clientSuite(java.lang.String name)
private static BaseTestSuite embeddedSuite(java.lang.String name)
public static junit.framework.Test suite()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.