use of javax.ejb.ConcurrentAccessException in project tomee by apache.
the class StatelessPoolStatsTest method testAccessTimeouts.
/**
* Requires an invocation against a maxed pool with all instances checked out, must be a strict pool
* javax.management.MBeanAttributeInfo[description=, name=AccessTimeouts, type=long, read-only, descriptor={}]
*
* @throws Exception On error
*/
public void testAccessTimeouts() throws Exception {
final Properties properties = new Properties();
properties.put("MaxSize", "10");
properties.put("AccessTimeout", "0");
properties.put("StrictPooling", "true");
final CounterBean bean = deploy("testAccessTimeouts", properties);
assertAttribute("AccessTimeouts", 0l);
final Checkout checkout = checkout(bean, 10);
for (int i = 0; i < 7; i++) {
try {
bean.doSomething();
fail("ConcurrentAccessException should have been thrown");
} catch (final ConcurrentAccessException expected) {
}
}
checkout.release();
assertAttribute("AccessTimeouts", 7l);
}
Aggregations