|
|||||||||
| 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.ClosedObjectTest
public class ClosedObjectTest
Test that all methods on ResultSet,
Statement, PreparedStatement,
CallableStatement and Connection objects
throw the appropriate exceptions when the objects are closed.
| Nested Class Summary | |
|---|---|
private static class |
ClosedObjectTest.CallableStatementObjectDecorator
Decorator class for testing methods on a closed callable statement. |
private static class |
ClosedObjectTest.ConnectionObjectDecorator
Decorator class for testing methods on a closed connection. |
private static class |
ClosedObjectTest.DataSourceDecorator
Decorator class used for obtaining connections through a DataSource. |
private static class |
ClosedObjectTest.ObjectDecorator
Abstract decorator class with functionality for obtaining a closed object. |
private static class |
ClosedObjectTest.PoolDataSourceDecorator
Decorator class used for obtaining connections through a ConnectionPoolDataSource. |
private static class |
ClosedObjectTest.PreparedStatementObjectDecorator
Decorator class for testing methods on a closed prepared statement. |
private static class |
ClosedObjectTest.ResultSetObjectDecorator
Decorator class for testing methods on a closed result set. |
private static class |
ClosedObjectTest.StatementObjectDecorator
Decorator class for testing methods on a closed statement. |
private static class |
ClosedObjectTest.XADataSourceDecorator
Decorator class used for obtaining connections through an XADataSource. |
| Field Summary | |
|---|---|
private ClosedObjectTest.ObjectDecorator |
decorator_
Test decorator which provides a closed object to invoke a method on. |
private java.lang.reflect.Method |
method_
The method to test. |
private java.lang.String |
name_
Name of the test. |
| Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase |
|---|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE |
| Constructor Summary | |
|---|---|
ClosedObjectTest(java.lang.reflect.Method method,
ClosedObjectTest.ObjectDecorator decorator)
Creates a new ClosedObjectTest instance. |
|
| Method Summary | |
|---|---|
private static junit.framework.Test |
baseSuite(java.lang.String name)
Creates the test suite and fills it with tests using DataSource, ConnectionPoolDataSource
and XADataSource to obtain objects. |
private static void |
fillDataSourceSuite(junit.framework.TestSuite suite,
ClosedObjectTest.DataSourceDecorator dsDecorator)
Fills a test suite which is contained in a DataSourceDecorator with tests for
ResultSet, Statement,
PreparedStatement, CallableStatement
and Connection. |
private static void |
fillObjectSuite(junit.framework.TestSuite suite,
ClosedObjectTest.ObjectDecorator decorator,
java.lang.Class iface)
Fills a suite with tests for all the methods of an interface. |
java.lang.String |
getName()
Gets the name of the test. |
private static java.lang.Object[] |
getNullArguments(java.lang.Class[] params)
Takes an array of classes and returns an array of objects with null values compatible with the classes. |
private static java.lang.Object |
getNullValueForType(java.lang.Class type)
Returns a null value compatible with the class. |
static junit.framework.Test |
suite()
Creates a suite with all tests in the class. |
void |
testClosedObjects()
Runs a test case. |
| 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, 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 final java.lang.reflect.Method method_
private final ClosedObjectTest.ObjectDecorator decorator_
private java.lang.String name_
| Constructor Detail |
|---|
public ClosedObjectTest(java.lang.reflect.Method method,
ClosedObjectTest.ObjectDecorator decorator)
ClosedObjectTest instance.
method - the method to testdecorator - a decorator which provides a closed object| Method Detail |
|---|
public java.lang.String getName()
getName in class junit.framework.TestCase
public void testClosedObjects()
throws java.lang.Throwable
java.lang.Throwable - if an error occurspublic static junit.framework.Test suite()
private static junit.framework.Test baseSuite(java.lang.String name)
DataSource, ConnectionPoolDataSource
and XADataSource to obtain objects.
Test value
java.lang.Exception - if an error occurs while building the test suite
private static void fillDataSourceSuite(junit.framework.TestSuite suite,
ClosedObjectTest.DataSourceDecorator dsDecorator)
DataSourceDecorator with tests for
ResultSet, Statement,
PreparedStatement, CallableStatement
and Connection.
suite - the test suite to filldsDecorator - the decorator for the test suite
private static void fillObjectSuite(junit.framework.TestSuite suite,
ClosedObjectTest.ObjectDecorator decorator,
java.lang.Class iface)
suite - the suite to filldecorator - a decorator for the test (used for obtaining a
closed object to test the method on)iface - the interface which contains the methods to testprivate static java.lang.Object[] getNullArguments(java.lang.Class[] params)
params - a Class[] value
Object[] valueprivate static java.lang.Object getNullValueForType(java.lang.Class type)
Boolean.FALSE for primitive booleans, 0 for
primitive integers and null for non-primitive
types.
type - a Class value
|
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 | ||||||||