poolingDSs = new ArrayList<PoolingDataSource>();
tm = TransactionManagerServices.getTransactionManager();
// in test DS setup
{
final XADataSource realInTestDs = (XADataSource) P6Util.forName(
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();