SerialTest (array of anonymous classes) + TestCas
[nikiroo-utils.git] / src / be / nikiroo / utils / test / TestCase.java
index 0479370f64df57bc5e27a809ee706b0908005f85..85a65d7a8cc83e716d499ea201efd481295d1867 100644 (file)
@@ -111,12 +111,28 @@ abstract public class TestCase {
         * 
         * @param reason
         *            the failure reason
+        * 
         * @throws AssertException
         *             every time
         */
        public void fail(String reason) throws AssertException {
+               fail(reason, null);
+       }
+
+       /**
+        * Force a failure.
+        * 
+        * @param reason
+        *            the failure reason
+        * @param e
+        *            the exception that caused the failure (can be NULL)
+        * 
+        * @throws AssertException
+        *             every time
+        */
+       public void fail(String reason, Exception e) throws AssertException {
                throw new AssertException("Failed!" + //
-                               reason != null ? "\n" + reason : "");
+                               reason != null ? "\n" + reason : "", e);
        }
 
        /**