|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.derbyTesting.junit.BaseTestCase
org.apache.derbyTesting.junit.BaseJDBCTestCase
org.apache.derbyTesting.functionTests.tests.jdbcapi.DataSourceSerializationTest
public class DataSourceSerializationTest
Makes sure that old serialized data sources can be de-serialized with the current version of the data souce.
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.
This test should detect the typical incompatible changes in the current data source implementations, for instance deleting a field or changing its type.
| Field Summary | |
|---|---|
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_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. |
| Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase |
|---|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE |
| Constructor Summary | |
|---|---|
DataSourceSerializationTest(java.lang.String name)
|
|
| Method Summary | |
|---|---|
private void |
deSerializeDs(java.lang.String className,
java.lang.String version)
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. |
| Methods inherited from class org.apache.derbyTesting.junit.BaseTestCase |
|---|
alarm, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertSecurityManager, assertThrowableEquals, execJavaCmd, fail, getFailureFolder, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeSystemProperty, runBare, setSystemProperty, traceit |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runTest, setName, setUp, toString |
| Methods inherited from class junit.framework.Assert |
|---|
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, fail, fail |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public DataSourceSerializationTest(java.lang.String name)
| Method Detail |
|---|
public void serTestEmbeddedDataSource()
throws java.lang.Exception
java.lang.Exception - for a number of error conditions
public void serTestEmbeddedConnectionPoolDataSource()
throws java.lang.Exception
java.lang.Exception - for a number of error conditions
public void serTestEmbeddedXADataSource()
throws java.lang.Exception
java.lang.Exception - for a number of error conditions
public void serTestClientDataSource()
throws java.lang.Exception
java.lang.Exception - for a number of error conditions
public void serTestClientConnectionPoolDataSource()
throws java.lang.Exception
java.lang.Exception - for a number of error conditions
public void serTestClientXADataSource()
throws java.lang.Exception
java.lang.Exception - for a number of error conditions
private void deSerializeDs(java.lang.String className,
java.lang.String version)
throws java.lang.Exception
If the object is successfully instantiated and cast to
DataSource
className - name of the class to de-serializeversion - Derby version
java.lang.Exception - on a number of error conditionspublic static junit.framework.Test suite()
|
Built on Thu 2009-11-26 18:42:53-0800, from revision 884739 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||