poolingDataSource.setClassName(MockitoXADataSource.class.getName());
poolingDataSource.setUniqueName("ds1");
poolingDataSource.setMaxPoolSize(1);
poolingDataSource.init();
Recoverer recoverer = new Recoverer();
recoverer.run();
assertEquals("a PoolingDataSource containing an XAPool of resource ds1 with 0 connection(s) (0 still available) -failed-", poolingDataSource.toString());
// recoverer must not unregister the resource
assertSame(poolingDataSource, ResourceRegistrar.get("ds1"));
MockitoXADataSource.setStaticGetXAConnectionException(null);
recoverer.run();
assertEquals("a PoolingDataSource containing an XAPool of resource ds1 with 1 connection(s) (1 still available)", poolingDataSource.toString());
// recoverer must not unregister the resource
assertSame(poolingDataSource, ResourceRegistrar.get("ds1"));
poolingDataSource.close();