|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mockrunner.mock.jdbc.JDBCMockObjectFactory
Used to create all types of JDBC mock objects.
Maintains the necessary dependencies between the mock objects.
If you use the mock objects returned by this
factory in your tests you can be sure, they are all
up to date.
Please note, that this class removes all drivers
from the JDBC DriverManager
and registers
the MockDriver
. All drivers are preserved and
can be restored with restoreDrivers()
.
Constructor Summary | |
JDBCMockObjectFactory()
Creates a new set of mock objects. |
Method Summary | |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JDBCMockObjectFactory()
Method Detail |
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.tearDown()
.
public MockDataSource getMockDataSource()
MockDataSource
.
MockDataSource
public MockDriver getMockDriver()
MockDriver
.
MockDriver
public MockConnection getMockConnection()
MockConnection
.
MockConnection
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |