diff --git a/test/testlibrary/com/oracle/java/testlibrary/Asserts.java b/test/testlibrary/com/oracle/java/testlibrary/Asserts.java index 176e883546b922e431df9f8b5f544f3b52abfb45..da3f428ea049e37fff33bb4d82af8071f42d64a2 100644 --- a/test/testlibrary/com/oracle/java/testlibrary/Asserts.java +++ b/test/testlibrary/com/oracle/java/testlibrary/Asserts.java @@ -436,6 +436,24 @@ public class Asserts { } } + /** + * Fail the test directly + * @throws RuntimeException anyway. + */ + public static void fail() { + error("Failed"); + } + + /** + * Fails a test with the given message. + * + * @param msg A description of the failure. + * + */ + public static void fail(String msg) { + error(msg); + } + private static > int compare(T lhs, T rhs, String msg) { assertNotNull(lhs, msg); assertNotNull(rhs, msg);