Skip to content

Commit aec423b

Browse files
author
Gary Gregory
committed
Better JUnit failures.
1 parent b325618 commit aec423b

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/test/java/org/apache/commons/io/ThreadMonitorTestCase.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void testCompletedWithoutTimeout() {
3939
TestUtils.sleep(100);
4040
ThreadMonitor.stop(monitor);
4141
} catch (final InterruptedException e) {
42-
fail("Timed Out");
42+
fail("Timed Out", e);
4343
}
4444
}
4545

@@ -51,11 +51,11 @@ public void testNoTimeoutMinus1() {
5151
// timeout = -1
5252
try {
5353
final Thread monitor = ThreadMonitor.start(Duration.ofMillis(-1));
54-
assertNull(monitor,"Timeout -1, Monitor should be null");
54+
assertNull(monitor, "Timeout -1, Monitor should be null");
5555
TestUtils.sleep(100);
5656
ThreadMonitor.stop(monitor);
5757
} catch (final Exception e) {
58-
fail("Timeout -1, threw " + e);
58+
fail("Timeout -1, threw " + e, e);
5959
}
6060
}
6161

@@ -71,7 +71,7 @@ public void testNoTimeoutZero() {
7171
TestUtils.sleep(100);
7272
ThreadMonitor.stop(monitor);
7373
} catch (final Exception e) {
74-
fail("Timeout 0, threw " + e);
74+
fail("Timeout 0, threw " + e, e);
7575
}
7676
}
7777

@@ -90,4 +90,3 @@ public void testTimeout() {
9090
}
9191
}
9292
}
93-

0 commit comments

Comments
 (0)