testOptions.getXaDataSource().getClass().getName()).newInstance();
setXADSProperties(realInTestDs, testOptions.getUrl().replace(":p6spy", ""),
testOptions.getUser(), testOptions.getPassword());
jndiResources.add(new Resource("jdbc/realInTestDs", realInTestDs));
final PoolingDataSource inTestDs = new PoolingDataSource();
inTestDs.setClassName(P6DataSource.class.getName());
inTestDs.setUniqueName("jdbc/inTestDs");
inTestDs.setMaxPoolSize(10);
inTestDs.getDriverProperties().setProperty("realDataSource", "jdbc/realInTestDs");
inTestDs.setAllowLocalTransactions(true);
inTestDs.init();
jndiResources.add(new Resource("jdbc/inTestDs", inTestDs));
poolingDSs.add(inTestDs);
}
// fixed DS setup
{
final XADataSource realFixedDs = (XADataSource) P6Util.forName("org.h2.jdbcx.JdbcDataSource")
.newInstance();
setXADSProperties(realFixedDs, "jdbc:h2:mem:p6spy_realFixedDs", "sa", "sa");
jndiResources.add(new Resource("jdbc/realFixedDs", realFixedDs));
final PoolingDataSource fixedDs = new PoolingDataSource();
fixedDs.setClassName(P6DataSource.class.getName());
fixedDs.setUniqueName("jdbc/fixedDs");
fixedDs.setMaxPoolSize(10);
fixedDs.getDriverProperties().setProperty("realDataSource", "jdbc/realFixedDs");
fixedDs.setAllowLocalTransactions(true);
fixedDs.init();
jndiResources.add(new Resource("jdbc/fixedDs", fixedDs));
poolingDSs.add(fixedDs);
}
// liquibase opens it's own transaction => keep it out of ours