You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ba...@apache.org on 2010/01/02 06:15:06 UTC

svn commit: r895122 - /commons/proper/lang/trunk/src/test/org/apache/commons/lang3/exception/ExceptionUtilsTest.java

Author: bayard
Date: Sat Jan  2 05:15:05 2010
New Revision: 895122

URL: http://svn.apache.org/viewvc?rev=895122&view=rev
Log:
Removing the selfCause tests. This is not a legal state for JDK Throwable cause properties, and I'm going to drop the support for people creating methods named 'setCause'. I can't find a lot of examples of this method naming in search engines. LANG-491

Modified:
    commons/proper/lang/trunk/src/test/org/apache/commons/lang3/exception/ExceptionUtilsTest.java

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang3/exception/ExceptionUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang3/exception/ExceptionUtilsTest.java?rev=895122&r1=895121&r2=895122&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang3/exception/ExceptionUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang3/exception/ExceptionUtilsTest.java Sat Jan  2 05:15:05 2010
@@ -63,7 +63,6 @@
     private Throwable withCause;
     private Throwable withoutCause;
     private Throwable jdkNoCause;
-    private ExceptionWithCause selfCause;
     private ExceptionWithCause cyclicCause;
 
     public ExceptionUtilsTest(String name) {
@@ -76,8 +75,6 @@
         nested = new NestableException(withoutCause);
         withCause = new ExceptionWithCause(nested);
         jdkNoCause = new NullPointerException();
-        selfCause = new ExceptionWithCause(null);
-        selfCause.setCause(selfCause);
         ExceptionWithCause a = new ExceptionWithCause(null);
         ExceptionWithCause b = new ExceptionWithCause(a);
         a.setCause(b);
@@ -90,7 +87,6 @@
         nested = null;
         withCause = null;
         jdkNoCause = null;
-        selfCause = null;
         cyclicCause = null;
     }
 
@@ -157,7 +153,6 @@
         assertSame(withoutCause, ExceptionUtils.getCause(nested));
         assertSame(nested, ExceptionUtils.getCause(withCause));
         assertSame(null, ExceptionUtils.getCause(jdkNoCause));
-        assertSame(selfCause, ExceptionUtils.getCause(selfCause));
         assertSame(cyclicCause.getCause(), ExceptionUtils.getCause(cyclicCause));
         assertSame(((ExceptionWithCause) cyclicCause.getCause()).getCause(), ExceptionUtils.getCause(cyclicCause.getCause()));
         assertSame(cyclicCause.getCause(), ExceptionUtils.getCause(((ExceptionWithCause) cyclicCause.getCause()).getCause()));
@@ -187,7 +182,6 @@
         assertSame(withoutCause, ExceptionUtils.getRootCause(nested));
         assertSame(withoutCause, ExceptionUtils.getRootCause(withCause));
         assertSame(null, ExceptionUtils.getRootCause(jdkNoCause));
-        assertSame(null, ExceptionUtils.getRootCause(selfCause));
         assertSame(((ExceptionWithCause) cyclicCause.getCause()).getCause(), ExceptionUtils.getRootCause(cyclicCause));
     }
 
@@ -217,7 +211,6 @@
         assertEquals(2, ExceptionUtils.getThrowableCount(nested));
         assertEquals(3, ExceptionUtils.getThrowableCount(withCause));
         assertEquals(1, ExceptionUtils.getThrowableCount(jdkNoCause));
-        assertEquals(1, ExceptionUtils.getThrowableCount(selfCause));
         assertEquals(3, ExceptionUtils.getThrowableCount(cyclicCause));
     }
 
@@ -253,12 +246,6 @@
         assertSame(jdkNoCause, throwables[0]);
     }
 
-    public void testGetThrowables_Throwable_selfCause() {
-        Throwable[] throwables = ExceptionUtils.getThrowables(selfCause);
-        assertEquals(1, throwables.length);
-        assertSame(selfCause, throwables[0]);
-    }
-
     public void testGetThrowables_Throwable_recursiveCause() {
         Throwable[] throwables = ExceptionUtils.getThrowables(cyclicCause);
         assertEquals(3, throwables.length);
@@ -300,12 +287,6 @@
         assertSame(jdkNoCause, throwables.get(0));
     }
 
-    public void testGetThrowableList_Throwable_selfCause() {
-        List<?> throwables = ExceptionUtils.getThrowableList(selfCause);
-        assertEquals(1, throwables.size());
-        assertSame(selfCause, throwables.get(0));
-    }
-
     public void testGetThrowableList_Throwable_recursiveCause() {
         List<?> throwables = ExceptionUtils.getThrowableList(cyclicCause);
         assertEquals(3, throwables.size());