Fail if expected Exception not thrown
MODIFY
src/test/java/org/apache/commons/io/monitor/FileAlterationMonitorTestCase.java
src/test/java/org/apache/commons/io/monitor/FileAlterationMonitorTestCase.java
@@ -102,6 +102,7 @@ public void testMonitor() {
try {
monitor.start(); // try and start again
+ fail("Expected IllegalStateException");
} catch (final IllegalStateException e) {
// expected result, monitor already running
}
@@ -129,6 +130,7 @@ public void testMonitor() {
try {
monitor.stop(); // try and stop again
+ fail("Expected IllegalStateException");
} catch (final IllegalStateException e) {
// expected result, monitor already stopped
}

Fail if expected Exception not thrown