Java Assert True assertTrue(final String message, final boolean condition)

Here you can find the source of assertTrue(final String message, final boolean condition)

Description

assert True

License

LGPL

Declaration

public static void assertTrue(final String message, final boolean condition) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static void assertTrue(final String message, final boolean condition) {
        if (!condition) {
            fail(message);/* ww  w.j  a v  a2s  .  co m*/
        }
    }

    public static void assertTrue(final boolean condition) {
        assertTrue(null, condition);
    }

    public static void fail(final Object message) {
        if (message == null) {
            throw new AssertionError();
        }

        throw new AssertionError(message);
    }
}

Related

  1. assertTrue(boolean expression)
  2. assertTrue(boolean expValue, String errMsg)
  3. assertTrue(boolean value)
  4. assertTrue(final boolean condition, final String message)
  5. assertTrue(final boolean result, final String faultDescription)
  6. assertTrue(String message, boolean condition)
  7. assertTrue(String message, boolean condition)
  8. assertTrue(String message, boolean condition)
  9. assertTrue(String msg, boolean value)