}
private void check(final DataSource ds, final String name) throws SQLException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
// the first "cast part" is not important, we just want to check the jdbc url is ok
assertThat(ds, instanceOf(BasicManagedDataSource.class));
final BasicManagedDataSource dbcp = (BasicManagedDataSource) ds;
final Connection connection = dbcp.getConnection();
assertThat(connection, instanceOf(ManagedConnection.class));
final ManagedConnection mc = (ManagedConnection) connection;
final Method getInnermostDelegateInternal = DelegatingConnection.class.getDeclaredMethod("getInnermostDelegateInternal");
getInnermostDelegateInternal.setAccessible(true);
final Connection delegate = (Connection) getInnermostDelegateInternal.invoke(mc);