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 TestMap.java
Date Fri, 15 Feb 2002 20:40:14 GMT
morgand     02/02/15 12:40:14

  Modified:    collections/src/test/org/apache/commons/collections
                        TestMap.java
  Log:
  makes sure that a Map inserts null values correctly
  
  Revision  Changes    Path
  1.2       +16 -4     jakarta-commons/collections/src/test/org/apache/commons/collections/TestMap.java
  
  Index: TestMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestMap.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestMap.java	20 Apr 2001 16:54:04 -0000	1.1
  +++ TestMap.java	15 Feb 2002 20:40:14 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestMap.java,v
1.1 2001/04/20 16:54:04 rwaldhoff Exp $
  - * $Revision: 1.1 $
  - * $Date: 2001/04/20 16:54:04 $
  + * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestMap.java,v
1.2 2002/02/15 20:40:14 morgand Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/02/15 20:40:14 $
    *
    * ====================================================================
    *
  @@ -76,7 +76,7 @@
    * test case (method) your {@link Map} fails.
    *
    * @author Rodney Waldhoff
  - * @version $Id: TestMap.java,v 1.1 2001/04/20 16:54:04 rwaldhoff Exp $
  + * @version $Id: TestMap.java,v 1.2 2002/02/15 20:40:14 morgand Exp $
    */
   public abstract class TestMap extends TestObject {
       public TestMap(String testName) {
  @@ -90,6 +90,18 @@
   
       public Object makeObject() {
           return makeMap();
  +    }
  +
  +    public void testMapSupportsNullValues() {
  +        Map map = makeMap();
  +        map.put(new Integer(1),"foo");
  +        
  +        assertTrue("no null values in Map",map.containsValue(null) == false);
  +
  +        map.put(new Integer(2),null);
  +
  +        assertTrue("null value in Map",map.containsValue(null));
  +        assertTrue("key to a null value",map.containsKey(new Integer(2)));
       }
   
       /*
  
  
  

--
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