Connection conn = createMock(Connection.class);
conn.setAutoCommit(true);
expect(conn.isClosed()).andReturn(true);
Driver driver = createMock(Driver.class);
String url = "jdbc:bar:baz";
expect(driver.acceptsURL(url)).andReturn(true);
expect(driver.connect(isA(String.class), isA(Properties.class))).andReturn(conn);
replay(driver, conn);
DriverManager.registerDriver(driver);
try {
JdbcConnectionSource sds = new JdbcConnectionSource(url, databaseType);