01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.util;
05:
06: import com.tc.test.TCTestCase;
07:
08: /**
09: * Unit test for {@link SameObjectEqualityComparator}.
10: */
11: public class SameObjectEqualityComparatorTest extends TCTestCase {
12:
13: public void testEquals() {
14: SameObjectEqualityComparator comparator = SameObjectEqualityComparator.INSTANCE;
15:
16: assertTrue(comparator.isEquals(null, null));
17: assertFalse(comparator.isEquals(new Integer(4), null));
18: assertFalse(comparator.isEquals(null, new Integer(4)));
19:
20: Integer x = new Integer(5);
21: Integer y = new Integer(5);
22:
23: assertTrue(comparator.isEquals(x, x));
24: assertFalse(comparator.isEquals(x, y));
25: assertFalse(comparator.isEquals(y, x));
26: assertTrue(comparator.isEquals(y, y));
27: }
28:
29: }
|