commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morg...@apache.org
Subject cvs commit: jakarta-commons/collections/src/test/org/apache/commons/collections TestSequencedHashMap.java
Date Fri, 15 Feb 2002 21:08:38 GMT
morgand     02/02/15 13:08:38

  Modified:    collections/src/test/org/apache/commons/collections
                        TestSequencedHashMap.java
  Log:
  added tests to make sure "youngest" promotion recognizes null values
  in all cases
  
  Revision  Changes    Path
  1.2       +24 -0     jakarta-commons/collections/src/test/org/apache/commons/collections/TestSequencedHashMap.java
  
  Index: TestSequencedHashMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestSequencedHashMap.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestSequencedHashMap.java	17 Sep 2001 16:43:49 -0000	1.1
  +++ TestSequencedHashMap.java	15 Feb 2002 21:08:38 -0000	1.2
  @@ -147,6 +147,30 @@
           }
       }
   
  +    public void testYoungest() {
  +        labRat.put(new Integer(1),"foo");
  +        labRat.put(new Integer(2),"bar");
  +        assertTrue("first key is correct",labRat.get(0).equals(new Integer(1)));
  +        labRat.put(new Integer(1),"boo");
  +        assertTrue("second key is reassigned to first",labRat.get(0).equals(new Integer(2)));
  +    }
  +
  +    public void testYoungestReplaceNullWithValue() {
  +        labRat.put(new Integer(1),null);
  +        labRat.put(new Integer(2),"foo");
  +        assertTrue("first key is correct",labRat.get(0).equals(new Integer(1)));
  +        labRat.put(new Integer(1),"bar");
  +        assertTrue("second key is reassigned to first",labRat.get(0).equals(new Integer(2)));
  +    }
  +
  +    public void testYoungestReplaceValueWithNull() {
  +        labRat.put(new Integer(1),"bar");
  +        labRat.put(new Integer(2),"foo");
  +        assertTrue("first key is correct",labRat.get(0).equals(new Integer(1)));
  +        labRat.put(new Integer(1),null);
  +        assertTrue("second key is reassigned to first",labRat.get(0).equals(new Integer(2)));
  +    }
  +
       protected void tearDown() {
           labRat = null;
       }
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message