use of org.apache.geronimo.transaction.manager.TransactionManagerImpl in project tomee by apache.
the class GeronimoConnectionManagerFactoryTest method evictionNotAllEquals.
@Test
public void evictionNotAllEquals() throws Exception {
final MyMcf mcf = new MyMcf();
final GeronimoConnectionManagerFactory factory = new GeronimoConnectionManagerFactory();
factory.setValidationInterval(new Duration("1 second"));
factory.setTransactionSupport("local");
factory.setMcf(mcf);
factory.setPooling(true);
factory.setPartitionStrategy("none");
factory.setTransactionManager(new TransactionManagerImpl());
factory.setPoolMinSize(1);
factory.setAllConnectionsEqual(false);
final GenericConnectionManager mgr = factory.create();
mgr.doStart();
try {
mgr.allocateConnection(mcf, new // just to use it
ConnectionRequestInfo() {
});
sleep(2500);
assertTrue(mcf.evicted.get());
assertTrue(mcf.destroyed.get());
} finally {
mgr.doStop();
}
}
use of org.apache.geronimo.transaction.manager.TransactionManagerImpl in project tomee by apache.
the class GeronimoConnectionManagerFactoryTest method eviction.
// ensure we don't have an exception TOMEE-1806
@Test
public void eviction() throws Exception {
final MyMcf mcf = new MyMcf();
final GeronimoConnectionManagerFactory factory = new GeronimoConnectionManagerFactory();
factory.setValidationInterval(new Duration("1 second"));
factory.setTransactionSupport("local");
factory.setMcf(mcf);
factory.setPooling(true);
factory.setPartitionStrategy("none");
factory.setTransactionManager(new TransactionManagerImpl());
factory.setPoolMinSize(1);
factory.setAllConnectionsEqual(true);
final GenericConnectionManager mgr = factory.create();
mgr.doStart();
try {
mgr.allocateConnection(mcf, new // just to use it
ConnectionRequestInfo() {
});
sleep(2500);
assertTrue(mcf.evicted.get());
assertTrue(mcf.destroyed.get());
} finally {
mgr.doStop();
}
}
Aggregations