Java Assert Equal assertEquals(Object obj1, Object obj2, String message)

Here you can find the source of assertEquals(Object obj1, Object obj2, String message)

Description

Solleva una @link(IllegalArgumentException) con message message in caso di object non null

License

Open Source License

Parameter

Parameter Description
object a parameter
message a parameter

Declaration

public static void assertEquals(Object obj1, Object obj2, String message) 

Method Source Code

//package com.java2s;
/**//from  w  ww  . ja v  a  2  s .  co m
 *   27/giu/2011
 *
 * Copyright (c) 2010 Alten Italia, All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Alten Italia ("Confidential Information").
 * You shall not disclose such Confidential Information and shall use it
 * only in accordance with the terms of the license agreement you entered 
 * into with Alten Italia.
 *
 * Alten Italia - MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY 
 * OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, 
 * OR NON-INFRINGEMENT. ALTEN ITALIA SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED
 * BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR 
 * ITS DERIVATIVES.
 */

public class Main {
    /**
     * Solleva una @link(IllegalArgumentException) con message message in caso di object non null
     * 
     * @param object
     * @param message
     */
    public static void assertEquals(Object obj1, Object obj2, String message) {
        if (!obj1.equals(obj2)) {
            throw new IllegalArgumentException(message);
        }
    }
}

Related

  1. assertEquals(Object exp, Object actual)
  2. assertEquals(Object expected, Object actual)
  3. assertEquals(Object expected, Object actual)
  4. assertEquals(Object o1, Object o2)
  5. assertEquals(Object obj1, Object obj2, String errMsg)
  6. assertEquals(Object val1, Object val2)
  7. assertEquals(String expected, String actual)
  8. assertEquals(String expected, String current)
  9. assertEquals(String message, Object expected, Object actual)