KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jodd > util > ObjectUtilTest


1 // Copyright (c) 2003-2007, Jodd Team (jodd.sf.net). All Rights Reserved.
2

3 package jodd.util;
4
5 import junit.framework.TestCase;
6
7 public class ObjectUtilTest extends TestCase {
8
9     public void testEquals() {
10         Object JavaDoc a = new Integer JavaDoc(173);
11         Object JavaDoc b = new Integer JavaDoc(1);
12         Object JavaDoc c = new Integer JavaDoc(173);
13
14         assertTrue(ObjectUtil.equals(a, a));
15         assertTrue(ObjectUtil.equals(a, c));
16         assertTrue(ObjectUtil.equals(c, a));
17         assertFalse(ObjectUtil.equals(a, b));
18         assertFalse(ObjectUtil.equals(b, a));
19
20         assertFalse(ObjectUtil.equals(a, null));
21         assertFalse(ObjectUtil.equals(null, a));
22
23         assertTrue(ObjectUtil.equalsEx(null, null));
24     }
25 }
26
Popular Tags