KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > dna > impl > ClassInstanceTest


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.object.dna.impl;
5
6 import junit.framework.TestCase;
7
8 public class ClassInstanceTest extends TestCase {
9
10   public void testEquals() {
11     ClassInstance c1 = new ClassInstance("name", "def");
12     ClassInstance c2 = new ClassInstance("name", "def");
13     ClassInstance c3 = new ClassInstance("def", "name");
14     assertEquals(c1, c2);
15     assertEquals(c1.hashCode(), c2.hashCode());
16     assertFalse(c1.equals(c3));
17     assertFalse(c3.equals(c1));
18   }
19
20 }
21
Popular Tags