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 expression)
Check that expression is true.
if (!expression) {
    throw new IllegalArgumentException("[Assertion failed] - this expression must be true");
voidassertTrue(boolean expValue, String errMsg)
assert True
if (!expValue) {
    throw new RuntimeException(errMsg);
voidassertTrue(boolean value)
assert True
if (!value) {
    fail("assertionFailed");
voidassertTrue(final boolean condition, final String message)
Assert that the statement is true, otherwise throw an exception with the provided message.
if (!condition) {
    throw new IllegalArgumentException(message);
voidassertTrue(final boolean result, final String faultDescription)
assert True
if (!result) {
    throw new IllegalArgumentException(String.format(
            "[Assertion failed error. Expected true value for %s, but got false]", faultDescription));
voidassertTrue(final String message, final boolean condition)
assert True
if (!condition) {
    fail(message);
voidassertTrue(String message, boolean condition)
Asserts that a condition is true.
if (!condition)
    fail(message);
voidassertTrue(String message, boolean condition)
assert True
if (!condition)
    fail(message);
voidassertTrue(String message, boolean condition)
assert True
if (!condition) {
    if (message == null) {
        throw new AssertionError();
    } else {
        throw new AssertionError(message);
voidassertTrue(String msg, boolean value)
AssertTrue with message
if (!value) {
    throw new AssertionError(msg);