use of org.mule.runtime.api.config.PoolingProfile in project mule by mulesoft.
the class PoolingConnectionManagementStrategyTestCase method exhaustion.
@Test
public void exhaustion() throws Exception {
poolingProfile = new PoolingProfile(1, 1, DEFAULT_MAX_POOL_WAIT, WHEN_EXHAUSTED_FAIL, INITIALISE_NONE);
initStrategy();
ConnectionHandler<Object> connectionHandler = strategy.getConnectionHandler();
try {
strategy.getConnectionHandler();
fail("Was expecting the pool to be exhausted");
} catch (ConnectionException e) {
// wiiiii
}
connectionHandler.release();
assertThat(strategy.getConnectionHandler(), is(notNullValue()));
}
use of org.mule.runtime.api.config.PoolingProfile in project mule by mulesoft.
the class AbstractPoolingTestCase method createDefaultPoolingProfile.
protected PoolingProfile createDefaultPoolingProfile() {
PoolingProfile poolingProfile = new PoolingProfile();
poolingProfile.setExhaustedAction(DEFAULT_EXHAUSTED_ACTION);
poolingProfile.setInitialisationPolicy(DEFAULT_INITIALISATION_POLICY);
poolingProfile.setMaxActive(MAX_ACTIVE);
poolingProfile.setMaxIdle(MAX_IDLE);
poolingProfile.setMaxWait(MAX_WAIT);
return poolingProfile;
}
Aggregations