Java Assert True assertTrue(String msg, boolean value)

Here you can find the source of assertTrue(String msg, boolean value)

Description

AssertTrue with message

License

Open Source License

Declaration

public static void assertTrue(String msg, boolean value) 

Method Source Code

//package com.java2s;
/**// ww  w  .j ava2  s  .  com
 * <copyright>
 *
 * Copyright (c) 2005, 2006, 2007, 2008 Springsite BV (The Netherlands) and others
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Martin Taal - Initial API and implementation
 *
 * </copyright>
 *
 * $Id: AssertUtil.java,v 1.7 2009/03/30 07:53:04 mtaal Exp $
 */

public class Main {
    /** AssertTrue with message */
    public static void assertTrue(String msg, boolean value) {
        if (!value) {
            throw new AssertionError(msg);
        }
    }
}

Related

  1. assertTrue(final boolean result, final String faultDescription)
  2. assertTrue(final String message, final boolean condition)
  3. assertTrue(String message, boolean condition)
  4. assertTrue(String message, boolean condition)
  5. assertTrue(String message, boolean condition)