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