01: ///////////////////////////////////////////////////////////////////////////////
02: // Copyright (c) 2001-2006, Eric D. Friedman All Rights Reserved.
03: //
04: // This library is free software; you can redistribute it and/or
05: // modify it under the terms of the GNU Lesser General Public
06: // License as published by the Free Software Foundation; either
07: // version 2.1 of the License, or (at your option) any later version.
08: //
09: // This library is distributed in the hope that it will be useful,
10: // but WITHOUT ANY WARRANTY; without even the implied warranty of
11: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: // GNU General Public License for more details.
13: //
14: // You should have received a copy of the GNU Lesser General Public
15: // License along with this program; if not, write to the Free Software
16: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17: ///////////////////////////////////////////////////////////////////////////////
18:
19: package gnu.trove;
20:
21: /**
22: *
23: * Created: Sat Aug 17 11:22:30 2002
24: *
25: * @author Eric Friedman
26: * @version $Id: TIdentityHashMapTest.java,v 1.1 2006/11/10 23:28:00 robeden Exp $
27: */
28:
29: public class TIdentityHashMapTest extends THashMapTest {
30:
31: public TIdentityHashMapTest(String name) {
32: super (name);
33: }
34:
35: public void setUp() throws Exception {
36: super .setUp();
37: map = new THashMap(new TObjectIdentityHashingStrategy());
38: count = 0;
39: }
40:
41: public void testIdentityHash() throws Exception {
42: Integer i1, i2;
43: i1 = new Integer(1);
44: i2 = new Integer(1);
45:
46: map.put(i1, i1);
47: assertTrue(map.containsKey(i1));
48: assertTrue(!map.containsKey(i2));
49: }
50:
51: public void testBadlyWrittenKey() {
52: ; // this test not applicable in identity hashing
53: }
54: } // TIdentityHashMapTests
|