This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-pool.git
The following commit(s) were added to refs/heads/master by this push:
new 84ac062 Fix tests (again, failing on GH, ok, locally).
84ac062 is described below
commit 84ac062960996efb5701a5a85f39f8a818082e15
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Aug 13 11:29:23 2021 -0400
Fix tests (again, failing on GH, ok, locally).
---
.../org/apache/commons/pool2/impl/TestGenericObjectPool.java | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git
a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java
b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java
index ffa97a0..34bc7f0 100644
--- a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java
+++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java
@@ -1041,11 +1041,15 @@ public class TestGenericObjectPool extends
TestBaseObjectPool {
// Sleep MUST be "long enough" to detect that more than 0 milliseconds
have elapsed.
// Need an API in Java 8 to get the clock granularity.
Thread.sleep(200);
+
assertFalse(dpo.getActiveDuration().isNegative());
assertFalse(dpo.getActiveDuration().isZero());
+ assertThat(dpo.getActiveDuration(),
lessThanOrEqualTo(dpo.getIdleDuration()));
+ // Depreacted
assertThat(dpo.getActiveDuration().toMillis(),
lessThanOrEqualTo(dpo.getActiveTimeMillis()));
assertThat(dpo.getActiveDuration(),
lessThanOrEqualTo(dpo.getActiveTime()));
- assertThat(dpo.getActiveDuration(),
lessThanOrEqualTo(dpo.getIdleDuration()));
+ assertThat(dpo.getActiveDuration(),
lessThanOrEqualTo(dpo.getIdleTime()));
+ assertThat(dpo.getActiveDuration().toMillis(),
lessThanOrEqualTo(dpo.getIdleTimeMillis()));
//
assertThat(dpo.getCreateInstant(),
lessThanOrEqualTo(dpo.getLastBorrowInstant()));
assertThat(dpo.getCreateInstant(),
lessThanOrEqualTo(dpo.getLastReturnInstant()));
@@ -1055,13 +1059,16 @@ public class TestGenericObjectPool extends
TestBaseObjectPool {
assertThat(lastReturnInstant1,
lessThanOrEqualTo(dpo.getLastReturnInstant()));
assertThat(lastUsedInstant1,
lessThanOrEqualTo(dpo.getLastUsedInstant()));
- // Return
genericObjectPool.returnObject(object);
assertFalse(dpo.getActiveDuration().isNegative());
assertFalse(dpo.getActiveDuration().isZero());
assertThat(dpo.getActiveDuration().toMillis(),
lessThanOrEqualTo(dpo.getActiveTimeMillis()));
assertThat(dpo.getActiveDuration(),
lessThanOrEqualTo(dpo.getActiveTime()));
+
+ assertThat(lastBorrowInstant1,
lessThanOrEqualTo(dpo.getLastBorrowInstant()));
+ assertThat(lastReturnInstant1,
lessThanOrEqualTo(dpo.getLastReturnInstant()));
+ assertThat(lastUsedInstant1,
lessThanOrEqualTo(dpo.getLastUsedInstant()));
}
/*