Java Utililty Methods Assert True

List of utility methods to do Assert True

Description

The list of methods to do Assert True are organized into topic(s).

Method

voidassertTrue(boolean b)
Throws an internal error if condition is not true.
if (!b) {
    newInternal("assert failed");
voidassertTrue(boolean b, String msgTemplate, Object... params)
assert True
if (!b) {
    throw new IllegalArgumentException(getMsg("Assert fail: not true.", msgTemplate, params));
voidassertTrue(boolean condition)
assert True
assert condition;
voidassertTrue(boolean condition)
assert True
if (!condition) {
    throw new IllegalArgumentException();
voidassertTrue(boolean condition, String argName, String message)
assert True
if (!condition) {
    throw new IllegalArgumentException(argName + ": " + message);
voidassertTrue(boolean condition, String message)
Solleva una @link(IllegalArgumentException) con message message in caso di condition false
if (!condition) {
    throw new IllegalArgumentException(message);
voidassertTrue(boolean condition, String message)
assert True
if (!condition) {
    fail(message);
voidassertTrue(boolean condition, String msg)
Helper method to assert the condition is satisfied.
if (!condition) {
    if (msg != null) {
        throw new RuntimeException(msg);
    } else {
        throw new RuntimeException();
voidassertTrue(boolean evalResult, Object... messages)
assert True
if (!evalResult) {
    StringBuilder buf = new StringBuilder();
    for (Object message : messages) {
        buf.append(message.toString());
        buf.append(", ");
    if (buf.length() > 0) {
        buf.setLength(buf.length() - 2);
...
voidassertTrue(boolean express)
assert True
assertTrue(express, "[Assertion failed] - This expression must be true.");