Java Assert True assertTrue(boolean condition, String message)

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

Description

assert True

License

Mozilla Public License

Declaration

public static void assertTrue(boolean condition, String message) 

Method Source Code

//package com.java2s;
/*//from  w ww .  jav a2  s.co  m
 * #%L
 * JsInterop.xyz
 * %%
 * Copyright (C) 2015 Norbert S?ndor
 * %%
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 * #L%
 */

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

    public static void assertTrue(boolean condition, String message) {
        if (!condition) {
            fail(message);
        }
    }

    public static void fail(String message) {
        throw new AssertionError(message);
    }
}

Related

  1. assertTrue(boolean b)
  2. assertTrue(boolean b, String msgTemplate, Object... params)
  3. assertTrue(boolean condition)
  4. assertTrue(boolean condition)
  5. assertTrue(boolean condition, String argName, String message)
  6. assertTrue(boolean condition, String message)
  7. assertTrue(boolean condition, String msg)
  8. assertTrue(boolean evalResult, Object... messages)
  9. assertTrue(boolean express)