commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/collections/src/test/org/apache/commons/collections/bidimap AbstractTestBidiMap.java
Date Sun, 14 Dec 2003 13:00:37 GMT
scolebourne    2003/12/14 05:00:37

  Modified:    collections/src/test/org/apache/commons/collections/bidimap
                        AbstractTestBidiMap.java
  Log:
  Add additional tests for coverage
  
  Revision  Changes    Path
  1.7       +22 -4     jakarta-commons/collections/src/test/org/apache/commons/collections/bidimap/AbstractTestBidiMap.java
  
  Index: AbstractTestBidiMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/bidimap/AbstractTestBidiMap.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AbstractTestBidiMap.java	3 Dec 2003 12:59:36 -0000	1.6
  +++ AbstractTestBidiMap.java	14 Dec 2003 13:00:37 -0000	1.7
  @@ -277,7 +277,13 @@
   
       //-----------------------------------------------------------------------
       public void testBidiClear() {
  -        if (isRemoveSupported() == false) return;
  +        if (isRemoveSupported() == false) {
  +            try {
  +                makeFullBidiMap().clear();
  +                fail();
  +            } catch(UnsupportedOperationException ex) {}
  +            return;
  +        }
   
           BidiMap map = makeFullBidiMap();
           map.clear();
  @@ -294,13 +300,25 @@
   
       //-----------------------------------------------------------------------
       public void testBidiRemove() {
  -        if (isRemoveSupported() == false) return;
  +        if (isRemoveSupported() == false) {
  +            try {
  +                makeFullBidiMap().remove(entries[0][0]);
  +                fail();
  +            } catch(UnsupportedOperationException ex) {}
  +            try {
  +                makeFullBidiMap().removeValue(entries[0][1]);
  +                fail();
  +            } catch(UnsupportedOperationException ex) {}
  +            return;
  +        }
           
           remove(makeFullBidiMap(), entries[0][0]);
           remove(makeFullBidiMap().inverseBidiMap(), entries[0][1]);
   
           removeValue(makeFullBidiMap(), entries[0][1]);
           removeValue(makeFullBidiMap().inverseBidiMap(), entries[0][0]);
  +        
  +        assertEquals(null, makeFullBidiMap().removeValue("NotPresent"));
       }
   
       private final void remove(BidiMap map, Object key) {
  
  
  

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


Mime
View raw message