--- old/test/testlibrary/com/oracle/java/testlibrary/Asserts.java 2019-01-28 17:45:05.000000000 +0800 +++ new/test/testlibrary/com/oracle/java/testlibrary/Asserts.java 2019-01-28 17:45:05.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -436,6 +436,24 @@ } } + /** + * 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);