1
2
3
4
5
6
7 package org.mule.util.pool;
8
9 import org.mule.config.PoolingProfile;
10 import org.mule.tck.junit4.AbstractMuleContextTestCase;
11
12 public abstract class AbstractPoolingTestCase extends AbstractMuleContextTestCase
13 {
14 protected static final int DEFAULT_EXHAUSTED_ACTION = PoolingProfile.WHEN_EXHAUSTED_FAIL;
15 protected static final int DEFAULT_INITIALISATION_POLICY = PoolingProfile.INITIALISE_NONE;
16 protected static final int MAX_ACTIVE = 3;
17 protected static final int MAX_IDLE = -1;
18 protected static final long MAX_WAIT = 1500;
19
20 protected PoolingProfile createDefaultPoolingProfile()
21 {
22 PoolingProfile poolingProfile = new PoolingProfile();
23 poolingProfile.setExhaustedAction(DEFAULT_EXHAUSTED_ACTION);
24 poolingProfile.setInitialisationPolicy(DEFAULT_INITIALISATION_POLICY);
25 poolingProfile.setMaxActive(MAX_ACTIVE);
26 poolingProfile.setMaxIdle(MAX_IDLE);
27 poolingProfile.setMaxWait(MAX_WAIT);
28 return poolingProfile;
29 }
30 }