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 AbstractTestBidiMap.java
Date Sun, 02 Nov 2003 18:29:33 GMT
scolebourne    2003/11/02 10:29:33

  Modified:    collections/src/test/org/apache/commons/collections
                        AbstractTestBidiMap.java
  Log:
  Correct errors in testing exceptions
  
  Revision  Changes    Path
  1.6       +12 -2     jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestBidiMap.java
  
  Index: AbstractTestBidiMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestBidiMap.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractTestBidiMap.java	2 Nov 2003 15:27:54 -0000	1.5
  +++ AbstractTestBidiMap.java	2 Nov 2003 18:29:33 -0000	1.6
  @@ -482,25 +482,31 @@
           assertEquals(false, it.hasNext());
           try {
               it.next();
  +            fail();
           } catch (NoSuchElementException ex) {}
           try {
               it.getKey();
  +            fail();
           } catch (IllegalStateException ex) {
           }
           try {
               it.getValue();
  +            fail();
           } catch (IllegalStateException ex) {
           }
           try {
               it.remove();
  +            fail();
           } catch (IllegalStateException ex) {
           }
           try {
               it.setValue(null);
  +            fail();
           } catch (IllegalStateException ex) {
           }
           try {
               it.asMapEntry();
  +            fail();
           } catch (IllegalStateException ex) {
           }
           verify();
  @@ -550,6 +556,7 @@
           if (isRemoveSupported() == false) {
               try {
                   it.remove();
  +                fail();
               } catch (UnsupportedOperationException ex) {
               }
               return;
  @@ -581,6 +588,7 @@
           if (isSetValueSupported() == false) {
               try {
                   it.setValue(newValue1);
  +                fail();
               } catch (UnsupportedOperationException ex) {
               }
               return;
  @@ -618,6 +626,7 @@
           // key1=newValue1, key2=newValue2
           try {
               it.setValue(newValue1);  // should remove key1
  +            fail();
           } catch (IllegalArgumentException ex) {
               return;  // simplest way of dealing with tricky situation
           }
  @@ -661,6 +670,7 @@
           
           try {
               it.setValue(newValue1);
  +            fail();
           } catch (IllegalStateException ex) {
           }
           verify();
  
  
  

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