@Test public void testGetDriverLocator() { String testurl = "testurl"; Driver driver = mock( Driver.class ); AbstractDatabaseDialect dialect = mock( AbstractDatabaseDialect.class ); when( dialect.getDriver( testurl ) ).thenReturn( driver ); assertEquals( driver, PooledDatasourceHelper.getDriver( dialect, null, testurl ) ); }
static Driver getDriver( IDatabaseDialect dialect, String driverClass, String url ) { if ( dialect instanceof IDriverLocator ) { return ( (IDriverLocator) dialect ).getDriver( url ); } else { return ObjectUtilities.loadAndInstantiate( driverClass, PooledDatasourceHelper.class, Driver.class ); } }
PooledDatasourceHelper { static Driver getDriver( IDatabaseDialect dialect, String driverClass, String url ) { if ( dialect instanceof IDriverLocator ) { return ( (IDriverLocator) dialect ).getDriver( url ); } else { return ObjectUtilities.loadAndInstantiate( driverClass, PooledDatasourceHelper.class, Driver.class ); } } }
PooledDatasourceHelper { static Driver getDriver( IDatabaseDialect dialect, String driverClass, String url ) { if ( dialect instanceof IDriverLocator ) { return ( (IDriverLocator) dialect ).getDriver( url ); } else { return ObjectUtilities.loadAndInstantiate( driverClass, PooledDatasourceHelper.class, Driver.class ); } } private  PooledDatasourceHelper(); }
PooledDatasourceHelper { static Driver getDriver( IDatabaseDialect dialect, String driverClass, String url ) { if ( dialect instanceof IDriverLocator ) { return ( (IDriverLocator) dialect ).getDriver( url ); } else { return ObjectUtilities.loadAndInstantiate( driverClass, PooledDatasourceHelper.class, Driver.class ); } } private  PooledDatasourceHelper(); static PoolingDataSource setupPooledDataSource( final IDatabaseConnection databaseConnection ); }
PooledDatasourceHelper { static Driver getDriver( IDatabaseDialect dialect, String driverClass, String url ) { if ( dialect instanceof IDriverLocator ) { return ( (IDriverLocator) dialect ).getDriver( url ); } else { return ObjectUtilities.loadAndInstantiate( driverClass, PooledDatasourceHelper.class, Driver.class ); } } private  PooledDatasourceHelper(); static PoolingDataSource setupPooledDataSource( final IDatabaseConnection databaseConnection ); static final String GENERIC; }