X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2Ftest%2FTestCase.java;h=85a65d7a8cc83e716d499ea201efd481295d1867;hp=0479370f64df57bc5e27a809ee706b0908005f85;hb=edeff2abd7f57e62c478a07c7dc2d138c96f408e;hpb=72648e757f648cd152bc00dfb83f895260f037a0 diff --git a/src/be/nikiroo/utils/test/TestCase.java b/src/be/nikiroo/utils/test/TestCase.java index 0479370..85a65d7 100644 --- a/src/be/nikiroo/utils/test/TestCase.java +++ b/src/be/nikiroo/utils/test/TestCase.java @@ -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); } /**