You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/03/07 15:43:12 UTC
[commons-pool] 02/02: Better test failure message
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
commit f9b2049b5bf37015005392a442f74acbacd0deae
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Mar 7 10:43:05 2023 -0500
Better test failure message
---
pom.xml | 6 ++++++
.../org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index e25ea42d..26583fc4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -157,6 +157,12 @@
<version>2.2</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.12.0</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<distributionManagement>
diff --git a/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java b/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
index 3994c219..dbd28c28 100644
--- a/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
+++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
@@ -55,6 +55,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import javax.management.MBeanServer;
import javax.management.ObjectName;
+import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.commons.pool2.BaseKeyedPooledObjectFactory;
import org.apache.commons.pool2.DestroyMode;
import org.apache.commons.pool2.KeyedObjectPool;
@@ -1002,7 +1003,7 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool {
Waiter.sleepQuietly(500L);
}
if (threads[i].failed()) {
- fail("Thread " + i + " failed: " + threads[i].exception.toString());
+ fail("Thread " + i + " failed: " + ExceptionUtils.getStackTrace(threads[i].exception));
}
}
}