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 2021/09/20 02:11:27 UTC

[commons-io] 07/09: Better JUnit failures.

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-io.git

commit aec423b48428d64dd582ddac09dd0f86256c2e31
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Sep 19 22:03:56 2021 -0400

    Better JUnit failures.
---
 src/test/java/org/apache/commons/io/ThreadMonitorTestCase.java | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/test/java/org/apache/commons/io/ThreadMonitorTestCase.java b/src/test/java/org/apache/commons/io/ThreadMonitorTestCase.java
index e22b052..5a70484 100644
--- a/src/test/java/org/apache/commons/io/ThreadMonitorTestCase.java
+++ b/src/test/java/org/apache/commons/io/ThreadMonitorTestCase.java
@@ -39,7 +39,7 @@ public class ThreadMonitorTestCase {
             TestUtils.sleep(100);
             ThreadMonitor.stop(monitor);
         } catch (final InterruptedException e) {
-            fail("Timed Out");
+            fail("Timed Out", e);
         }
     }
 
@@ -51,11 +51,11 @@ public class ThreadMonitorTestCase {
         // timeout = -1
         try {
             final Thread monitor = ThreadMonitor.start(Duration.ofMillis(-1));
-            assertNull(monitor,"Timeout -1, Monitor should be null");
+            assertNull(monitor, "Timeout -1, Monitor should be null");
             TestUtils.sleep(100);
             ThreadMonitor.stop(monitor);
         } catch (final Exception e) {
-            fail("Timeout -1, threw " + e);
+            fail("Timeout -1, threw " + e, e);
         }
     }
 
@@ -71,7 +71,7 @@ public class ThreadMonitorTestCase {
             TestUtils.sleep(100);
             ThreadMonitor.stop(monitor);
         } catch (final Exception e) {
-            fail("Timeout 0, threw " + e);
+            fail("Timeout 0, threw " + e, e);
         }
     }
 
@@ -90,4 +90,3 @@ public class ThreadMonitorTestCase {
         }
     }
 }
-