|
|||||||||
| 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.functionTests.tests.jdbc4.VerifySignatures
public class VerifySignatures
JUnit test which checks that all methods specified by the interfaces in JDBC 4.0 are implemented. The test requires JVM 1.6 to run. Even though this class uses JDBC it extends BaseTestCase as it handles getting connections itself and thus does not need the utility methods or connecion handlng provided by BaseJDBCTestCase.
| Nested Class Summary | |
|---|---|
private static class |
VerifySignatures.ClassInfo
Data structure holding a Derby implementation class and the JDBC interface it is supposed to implement. |
| Field Summary | |
|---|---|
private static java.lang.Class[] |
JDBC_INTERFACES
All the java.sql and javax.sql interfaces specified by JDBC 4.0. |
| Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase |
|---|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE |
| Constructor Summary | |
|---|---|
VerifySignatures(java.lang.String name)
Creates a new instance. |
|
| Method Summary | |
|---|---|
private static void |
addClass(java.util.Set<VerifySignatures.ClassInfo> classes,
java.lang.Class implementation,
java.lang.Class iface)
Adds a ClassInfo object to a set. |
private static void |
checkImplementationMethod(java.lang.Class derbyImplementation,
java.lang.reflect.Method ifaceMethod)
checks that a class implements a specific method. |
private static void |
collectClassesFromCallableStatement(java.sql.Connection conn,
java.util.Set<VerifySignatures.ClassInfo> classes)
Perform JDBC operations on a CallableStatement. |
private static void |
collectClassesFromConnection(java.sql.Connection conn,
java.util.Set<VerifySignatures.ClassInfo> classes)
Perform JDBC operations on a Connection. |
private static void |
collectClassesFromConnectionPoolDataSource(java.util.Set<VerifySignatures.ClassInfo> classes)
Obtain a connection from a ConnectionPoolDataSource
object and perform JDBC operations on it. |
private static void |
collectClassesFromDataSource(java.util.Set<VerifySignatures.ClassInfo> classes)
Obtain a connection from a DataSource object and
perform JDBC operations on it. |
private static void |
collectClassesFromPreparedStatement(java.sql.Connection conn,
java.util.Set<VerifySignatures.ClassInfo> classes)
Perform JDBC operations on a PreparedStatement. |
private static void |
collectClassesFromStatement(java.sql.Connection conn,
java.util.Set<VerifySignatures.ClassInfo> classes)
Perform JDBC operations on a Statement. |
private static void |
collectClassesFromXADataSource(java.util.Set<VerifySignatures.ClassInfo> classes)
Obtain a connection from an XADataSource object
and perform JDBC operations on it. |
private static java.lang.Class |
findCompatibleClass(java.lang.Class exception,
java.lang.Class[] declared)
Search an array of classes for a class that is identical to or a super-class of the specified exception class. |
private static java.util.Set<java.lang.Class> |
getAllInterfaces(java.lang.Class iface)
Get the set consisting of an interface and all its super-interfaces. |
private static java.util.Set<java.lang.Class> |
getInterfacesToCheck()
Returns the declared set of JDBC interfaces that Derby implements. |
static junit.framework.Test |
suite()
Build a suite of tests to be run. |
void |
testAllJDBCObjects()
|
| 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, tearDown, 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.Class[] JDBC_INTERFACES
| Constructor Detail |
|---|
public VerifySignatures(java.lang.String name)
| Method Detail |
|---|
public static junit.framework.Test suite()
public void testAllJDBCObjects()
throws java.lang.NoSuchMethodException,
java.sql.SQLException
java.lang.NoSuchMethodException
java.sql.SQLException
private static void collectClassesFromDataSource(java.util.Set<VerifySignatures.ClassInfo> classes)
throws java.sql.SQLException
DataSource object and
perform JDBC operations on it. Collect the classes of all JDBC
objects that are found.
classes - set into which classes are collected
java.sql.SQLException - if a database error occurs
private static void collectClassesFromConnectionPoolDataSource(java.util.Set<VerifySignatures.ClassInfo> classes)
throws java.sql.SQLException
ConnectionPoolDataSource
object and perform JDBC operations on it. Collect the classes
of all JDBC objects that are found.
classes - set into which classes are collected
java.sql.SQLException - if a database error occurs
private static void collectClassesFromXADataSource(java.util.Set<VerifySignatures.ClassInfo> classes)
throws java.sql.SQLException
XADataSource object
and perform JDBC operations on it. Collect the classes of all
JDBC objects that are found.
classes - set into which classes are collected
java.sql.SQLException - if a database error occurs
private static void collectClassesFromConnection(java.sql.Connection conn,
java.util.Set<VerifySignatures.ClassInfo> classes)
throws java.sql.SQLException
Connection. Collect
the classes of all JDBC objects that are found.
conn - connection to a databaseclasses - set into which classes are collected
java.sql.SQLException - if a database error occurs
private static void collectClassesFromStatement(java.sql.Connection conn,
java.util.Set<VerifySignatures.ClassInfo> classes)
throws java.sql.SQLException
Statement. Collect
the classes of all JDBC objects that are found.
conn - connection to a databaseclasses - set into which classes are collected
java.sql.SQLException - if a database error occurs
private static void collectClassesFromPreparedStatement(java.sql.Connection conn,
java.util.Set<VerifySignatures.ClassInfo> classes)
throws java.sql.SQLException
PreparedStatement.
Collect the classes of all JDBC objects that are found.
conn - connection to a databaseclasses - set into which classes are collected
java.sql.SQLException - if a database error occurs
private static void collectClassesFromCallableStatement(java.sql.Connection conn,
java.util.Set<VerifySignatures.ClassInfo> classes)
throws java.sql.SQLException
CallableStatement.
Collect the classes of all JDBC objects that are found.
conn - connection to a databaseclasses - set into which classes are collected
java.sql.SQLException - if a database error occurs
private static void addClass(java.util.Set<VerifySignatures.ClassInfo> classes,
java.lang.Class implementation,
java.lang.Class iface)
ClassInfo object to a set.
classes - set to which the class should be addedimplementation - Derby implementation classiface - JDBC interface supposed to be implementedprivate static java.util.Set<java.lang.Class> getAllInterfaces(java.lang.Class iface)
iface - an interface
iface and all its
super-interfaces
private static void checkImplementationMethod(java.lang.Class derbyImplementation,
java.lang.reflect.Method ifaceMethod)
throws java.lang.NoSuchMethodException
derbyImplementation - The Derby implementation class which is testedifaceMethod - The method that should be implemented.
java.lang.NoSuchMethodException
private static java.lang.Class findCompatibleClass(java.lang.Class exception,
java.lang.Class[] declared)
exception - an exception classdeclared - an array of exception classes declared to
be thrown by a method
null if no compatible
class is foundprivate static java.util.Set<java.lang.Class> getInterfacesToCheck()
|
Built on Sat 2009-11-28 18:44:18-0800, from revision 885187 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||