commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject cvs commit: jakarta-commons/lang/src/test/org/apache/commons/lang/exception ExceptionUtilsTestCase.java
Date Tue, 18 Mar 2003 06:14:23 GMT
bayard      2003/03/17 22:14:23

  Modified:    lang/src/test/org/apache/commons/lang/exception
                        ExceptionUtilsTestCase.java
  Log:
  Added a test case for isNestedThrowable
  
  Revision  Changes    Path
  1.7       +13 -0     jakarta-commons/lang/src/test/org/apache/commons/lang/exception/ExceptionUtilsTestCase.java
  
  Index: ExceptionUtilsTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/exception/ExceptionUtilsTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ExceptionUtilsTestCase.java	20 Jan 2003 23:04:19 -0000	1.6
  +++ ExceptionUtilsTestCase.java	18 Mar 2003 06:14:23 -0000	1.7
  @@ -149,6 +149,19 @@
           assertTrue("printRootCauseStackTrace(Throwable, PrintWriter) failed",
                      stackTrace.indexOf(ExceptionUtils.WRAPPED_MARKER) == -1);
       }
  +
  +    public void testIsNestedThrowable() {
  +        assertTrue("SQLException not nested", 
  +                   ExceptionUtils.isNestedThrowable(new java.sql.SQLException() ) );
  +        assertTrue("InvocationTargetException not nested", 
  +                   ExceptionUtils.isNestedThrowable(new java.lang.reflect.InvocationTargetException(
new Exception() ) ) );
  +        assertTrue("NestableRuntimeException not nested", 
  +                   ExceptionUtils.isNestedThrowable(new NestableRuntimeException() ) );
  +                   
  +        // TODO: Come up with a way to test if java.lang.Throwable is nested.
  +        // bearing in mind that in JDK 1.4 it is, and in 1.3 and previous 
  +        // it isn't.
  +    }
       
       /**
        * Provides a method with a well known chained/nested exception
  
  
  

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