use of org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyConnection in project wildfly by wildfly.
the class LazyAssociationSharableFalseTestCase method verifyDisabledLazyAssociation.
@Test
public void verifyDisabledLazyAssociation() {
assertNotNull(lcf);
LazyConnection lc1 = null;
LazyConnection lc2 = null;
try {
lc1 = lcf.getConnection();
assertTrue(lc1.isManagedConnectionSet());
try {
lc2 = lcf.getConnection();
fail("Exception should have been thrown");
} catch (ResourceException re) {
// expected
}
} catch (Throwable t) {
logger.error(t.getMessage(), t);
fail("Throwable:" + t.getLocalizedMessage());
} finally {
if (lc1 != null) {
lc1.close();
}
if (lc2 != null) {
lc2.close();
}
}
}
use of org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyConnection in project wildfly by wildfly.
the class LazyAssociationSharableFalseTestCase method testDefaultBehaviorWithoutLazyAssociation.
@Test
public void testDefaultBehaviorWithoutLazyAssociation() {
assertNotNull(lcf);
LazyConnection lc1 = null;
LazyConnection lc2 = null;
try {
lc1 = lcf.getConnection();
assertTrue(lc1.isManagedConnectionSet());
lc1.close();
lc2 = lcf.getConnection();
assertTrue(lc2.isManagedConnectionSet());
lc2.close();
} catch (Throwable t) {
logger.error(t.getMessage(), t);
fail("Throwable:" + t.getLocalizedMessage());
} finally {
if (lc1 != null) {
lc1.close();
}
if (lc2 != null) {
lc2.close();
}
}
}
Aggregations