Java Assert assertCondition(boolean condition, String msg)

Here you can find the source of assertCondition(boolean condition, String msg)

Description

assert Condition

License

Open Source License

Declaration

public static void assertCondition(boolean condition, String msg) 

Method Source Code

//package com.java2s;
/*/*from   w  w  w  .  j  av a 2  s. com*/
 * $Id$
 *
 * Copyright (C) 2003-2015 JNode.org
 *
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 
 * License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library; If not, write to the Free Software Foundation, Inc., 
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

public class Main {
    public static void assertCondition(boolean condition, String msg) {
        if (!condition) {
            throw new InternalError("Assertion failed: " + msg);
        }
    }
}

Related

  1. assertColor(int color)
  2. assertComparison(T actual, T expected)
  3. assertComparison(T actual, T expected)
  4. assertCond(boolean b)
  5. assertCondition(boolean condition, String message)
  6. assertContains(final String string, final String content)
  7. assertContains(String needle, String haystack)
  8. assertDescriptorName(String key)
  9. assertDidNotThrow(final Runnable r)