/** * Since <code>JDBCMockObjectFactory</code> removes all the * drivers from the <code>DriveManager</code> (so the * {@link MockDriver} is guaranteed to be the only one) * you can use this method to restore the original drivers. * Automatically called by {@link com.mockrunner.base.BaseTestCase#tearDown}. */ public void restoreDrivers() { deregisterMockDrivers(); try { Iterator drivers = preservedDrivers.iterator(); while(drivers.hasNext()) { DriverManager.registerDriver((Driver)drivers.next()); } } catch(SQLException exc) { throw new NestedApplicationException(exc); } preservedDrivers.clear(); }
/** * Since <code>JDBCMockObjectFactory</code> removes all the * drivers from the <code>DriveManager</code> (so the * {@link MockDriver} is guaranteed to be the only one) * you can use this method to restore the original drivers. * Automatically called by com.mockrunner.base.BaseTestCase#tearDown. */ public void restoreDrivers() { deregisterMockDrivers(); try { for (Driver preservedDriver : preservedDrivers) { DriverManager.registerDriver(preservedDriver); } } catch(SQLException exc) { throw new NestedApplicationException(exc); } preservedDrivers.clear(); }
/** * Since <code>JDBCMockObjectFactory</code> removes all the * drivers from the <code>DriveManager</code> (so the * {@link MockDriver} is guaranteed to be the only one) * you can use this method to restore the original drivers. * Automatically called by {@link com.mockrunner.base.BaseTestCase#tearDown}. */ public void restoreDrivers() { deregisterMockDrivers(); try { Iterator drivers = preservedDrivers.iterator(); while(drivers.hasNext()) { DriverManager.registerDriver((Driver)drivers.next()); } } catch(SQLException exc) { throw new NestedApplicationException(exc); } preservedDrivers.clear(); }