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/lang/src/test/org/apache/commons/lang/enum EnumTest.java
Date Fri, 13 Feb 2004 23:17:45 GMT
scolebourne    2004/02/13 15:17:45

  Modified:    lang/src/test/org/apache/commons/lang/enum EnumTest.java
  Log:
  Handle broken test actually working on Linux Sun JDK 1.4.1
  
  Revision  Changes    Path
  1.15      +11 -5     jakarta-commons/lang/src/test/org/apache/commons/lang/enum/EnumTest.java
  
  Index: EnumTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/enum/EnumTest.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- EnumTest.java	12 Feb 2004 01:00:05 -0000	1.14
  +++ EnumTest.java	13 Feb 2004 23:17:45 -0000	1.15
  @@ -62,6 +62,7 @@
   import java.util.List;
   import java.util.Map;
   
  +import junit.framework.AssertionFailedError;
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  @@ -432,10 +433,15 @@
   
       public void testNestedBroken() {
           List list = new ArrayList(NestBroken.ColorEnum.getEnumList());
  -        assertEquals(0, list.size());  // no enums!!! 
  -        // this is BROKEN because the enum constants are defined in a DIFFERENT
  -        // class from getEnumList(). Once NestBroken class is referenced,
  -        // and thus class loaded with its enum constants, the getEnumList works:
  +        try {
  +            assertEquals(0, list.size());  // no enums!!! 
  +            // this is BROKEN because the enum constants are defined in a DIFFERENT
  +            // class from getEnumList(). Once NestBroken class is referenced,
  +            // and thus class loaded with its enum constants, the getEnumList works:
  +        } catch (AssertionFailedError ex) {
  +            // this actually works and isn't broken on Linux SunJDK1.4.1, so...
  +            assertEquals(3, list.size());
  +        }
           new NestBroken();
           list = new ArrayList(NestBroken.ColorEnum.getEnumList());
           assertEquals(3, list.size());  // all is well!!!
  
  
  

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