public class DataSourceSerializationTest extends BaseJDBCTestCase
Serialized data source from old versions are expected to be found in testData/serializedDataSources, with the following filename format CLASSNAME-VERSION.ser, where CLASSNAME is the unqualified name of the data source class, and VERSION is the Derby version. An example: ClientPooledConnectionDataSource-10_1.ser
A separation between JDBC 4.0 specific classes and the other classes is not made before release 10.10.
This test should detect the typical incompatible changes in the current data source implementations, for instance deleting a field or changing its type.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
_40Suffix |
private static java.lang.String |
VERSION_10_0_2_1
Constant for Derby version 10.0.2.1.
|
private static java.lang.String |
VERSION_10_1_3_1
Constant for Derby version 10.1.3.1.
|
private static java.lang.String |
VERSION_10_10_1_0
Constant for Derby version 10.10.1.0.
|
private static java.lang.String |
VERSION_10_11_1_0
Constant for Derby version 10.11.1.0.
|
private static java.lang.String |
VERSION_10_2_2_0
Constant for Derby version 10.2.2.0
|
private static java.lang.String |
VERSION_10_3_2_1
Constant for Derby version 10.3.2.1.
|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
DataSourceSerializationTest(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
private void |
deSerializeDs(java.lang.String className,
java.lang.String version,
boolean dsHasJNDI)
Attempts to de-serialize a data source object from a file.
|
void |
serTestClientConnectionPoolDataSource()
Tests the de-serialization of the client connection pool data source.
|
void |
serTestClientDataSource()
Tests the de-serialization of the basic client data source.
|
void |
serTestClientXADataSource()
Tests the de-serialization of the client XA data source.
|
void |
serTestEmbeddedConnectionPoolDataSource()
Tests the de-serialization of the embedded connection pool data source.
|
void |
serTestEmbeddedDataSource()
Tests the de-serialization of the basic embedded data source.
|
void |
serTestEmbeddedXADataSource()
Tests the de-serialization of the embedded XA data source.
|
static junit.framework.Test |
suite()
Returns an appropariate suite of tests to run.
|
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
private static final java.lang.String VERSION_10_0_2_1
private static final java.lang.String VERSION_10_1_3_1
private static final java.lang.String VERSION_10_2_2_0
private static final java.lang.String VERSION_10_3_2_1
private static final java.lang.String VERSION_10_10_1_0
private static final java.lang.String VERSION_10_11_1_0
private final java.lang.String _40Suffix
public DataSourceSerializationTest(java.lang.String name)
public void serTestEmbeddedDataSource() throws java.lang.Exception
java.lang.Exception
- for a number of error conditionspublic void serTestEmbeddedConnectionPoolDataSource() throws java.lang.Exception
java.lang.Exception
- for a number of error conditionspublic void serTestEmbeddedXADataSource() throws java.lang.Exception
java.lang.Exception
- for a number of error conditionspublic void serTestClientDataSource() throws java.lang.Exception
java.lang.Exception
- for a number of error conditionspublic void serTestClientConnectionPoolDataSource() throws java.lang.Exception
java.lang.Exception
- for a number of error conditionspublic void serTestClientXADataSource() throws java.lang.Exception
java.lang.Exception
- for a number of error conditionsprivate void deSerializeDs(java.lang.String className, java.lang.String version, boolean dsHasJNDI) throws java.lang.Exception
If the object is successfully instantiated and cast to
DataSource
className
- name of the class to de-serializeversion
- Derby versionjava.lang.Exception
- on a number of error conditionspublic static junit.framework.Test suite()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.