public class JDBCMockObjectFactory extends Object
DriverManager and registers
the MockDriver. All drivers are preserved and
can be restored with restoreDrivers().| Constructor and Description |
|---|
JDBCMockObjectFactory()
Creates a new set of mock objects.
|
| Modifier and Type | Method and Description |
|---|---|
MockConnection |
createMockConnection()
Creates the
MockConnection using new. |
MockDataSource |
createMockDataSource()
Creates the
MockDataSource using new. |
MockDriver |
createMockDriver()
Creates the
MockDriver using new. |
MockConnection |
getMockConnection()
Returns the
MockConnection. |
MockDataSource |
getMockDataSource()
Returns the
MockDataSource. |
MockDriver |
getMockDriver()
Returns the
MockDriver. |
void |
registerMockDriver()
Removes all JDBC drivers from the
DriveManager and
registers the mock driver. |
void |
restoreDrivers()
Since
JDBCMockObjectFactory removes all the
drivers from the DriveManager (so the
MockDriver is guaranteed to be the only one)
you can use this method to restore the original drivers. |
public JDBCMockObjectFactory()
public void registerMockDriver()
DriveManager and
registers the mock driver. The removed drivers are preserved and
can be restored with restoreDrivers().public void restoreDrivers()
JDBCMockObjectFactory removes all the
drivers from the DriveManager (so the
MockDriver is guaranteed to be the only one)
you can use this method to restore the original drivers.
Automatically called by BaseTestCase.public MockConnection createMockConnection()
MockConnection using new.
This method can be overridden to return a subclass of MockConnection.MockConnectionpublic MockDriver createMockDriver()
MockDriverpublic MockDataSource createMockDataSource()
MockDataSource using new.
This method can be overridden to return a subclass of MockDataSource.MockDataSourcepublic MockDataSource getMockDataSource()
MockDataSource.MockDataSourcepublic MockDriver getMockDriver()
MockDriver.MockDriverpublic MockConnection getMockConnection()
MockConnection.MockConnectionCopyright © 2003-2014. All Rights Reserved.