commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r895122 - /commons/proper/lang/trunk/src/test/org/apache/commons/lang3/exception/ExceptionUtilsTest.java
Date Sat, 02 Jan 2010 05:15:06 GMT
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());



Mime
View raw message