Skip to content
Permalink
Browse files
Rename new method.
  • Loading branch information
garydgregory committed Aug 8, 2021
1 parent 18fe4f6 commit b08de2b9c9469c42924dd77473f6b44a71efa3aa
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
@@ -854,11 +854,11 @@ public void setLifo(final boolean lifo) {
*
* @see GenericObjectPool#getMaxWaitDuration()
* @see GenericKeyedObjectPool#getMaxWaitDuration()
* @deprecated Use {@link #setMaxWaitDuration(Duration)}.
* @deprecated Use {@link #setMaxWait(Duration)}.
*/
@Deprecated
public void setMaxWaitMillis(final long maxWaitMillis) {
setMaxWaitDuration(Duration.ofMillis(maxWaitMillis));
setMaxWait(Duration.ofMillis(maxWaitMillis));
}

/**
@@ -870,8 +870,9 @@ public void setMaxWaitMillis(final long maxWaitMillis) {
*
* @see GenericObjectPool#getMaxWaitDuration()
* @see GenericKeyedObjectPool#getMaxWaitDuration()
* @since 2.11.0
*/
public void setMaxWaitDuration(final Duration maxWaitDuration) {
public void setMaxWait(final Duration maxWaitDuration) {
this.maxWaitDuration = PoolImplUtils.nonNull(maxWaitDuration, DEFAULT_MAX_WAIT);
}

@@ -115,7 +115,7 @@ private void run() throws Exception {
poolConfig.setMaxIdlePerKey(-1);
poolConfig.setLifo(true);
poolConfig.setFairness(true);
poolConfig.setMaxWaitDuration(Duration.ofSeconds(30));
poolConfig.setMaxWait(Duration.ofSeconds(30));
poolConfig.setMinEvictableIdleTime(Duration.ofMillis(-1));
poolConfig.setSoftMinEvictableIdleTime(Duration.ofMillis(-1));
poolConfig.setNumTestsPerEvictionRun(1);
@@ -1222,7 +1222,7 @@ public void testConstructors() {
config.setMaxIdlePerKey(maxIdle);
config.setMinIdlePerKey(minIdle);
config.setMaxTotal(maxTotal);
config.setMaxWaitDuration(maxWaitDuration);
config.setMaxWait(maxWaitDuration);
config.setMinEvictableIdleTime(Duration.ofMillis(minEvictableIdleTimeMillis));
config.setNumTestsPerEvictionRun(numTestsPerEvictionRun);
config.setTestOnBorrow(testOnBorrow);
@@ -1672,7 +1672,7 @@ public void testInvalidateWaiting()
config.setMaxTotal(2);
config.setBlockWhenExhausted(true);
config.setMinIdlePerKey(0);
config.setMaxWaitDuration(Duration.ofMillis(-1));
config.setMaxWait(Duration.ofMillis(-1));
config.setNumTestsPerEvictionRun(Integer.MAX_VALUE); // always test all idle objects
config.setTestOnBorrow(true);
config.setTestOnReturn(false);
@@ -1323,7 +1323,7 @@ public void testConstructors() {
config.setMaxIdle(maxIdle);
config.setMinIdle(minIdle);
config.setMaxTotal(maxTotal);
config.setMaxWaitDuration(maxWaitDuration);
config.setMaxWait(maxWaitDuration);
config.setMinEvictableIdleTimeMillis(minEvictableIdleMillis);
assertEquals(minEvictableIdleMillis, config.getMinEvictableIdleTime().toMillis());
config.setNumTestsPerEvictionRun(numTestsPerEvictionRun);
@@ -2651,7 +2651,7 @@ public void testSetConfig() throws Exception {
assertConfiguration(expected,genericObjectPool);
expected.setMaxTotal(2);
expected.setMaxIdle(3);
expected.setMaxWaitDuration(Duration.ofMillis(5));
expected.setMaxWait(Duration.ofMillis(5));
expected.setMinEvictableIdleTime(Duration.ofMillis(7L));
expected.setNumTestsPerEvictionRun(9);
expected.setTestOnCreate(true);
@@ -119,7 +119,7 @@ public void testBorrowObjectStuck() {
config.setMinEvictableIdleTime(NEG_ONE_DURATION);
config.setSoftMinEvictableIdleTime(NEG_ONE_DURATION);

config.setMaxWaitDuration(NEG_ONE_DURATION);
config.setMaxWait(NEG_ONE_DURATION);
try (GenericObjectPool<Object> pool = new GenericObjectPool<>(factory, config)) {

final AtomicBoolean failed = new AtomicBoolean();

0 comments on commit b08de2b

Please sign in to comment.