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

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@895122 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2010-01-02 05:15:05 +00:00
parent 64f0e8ecb0
commit 228527bd83
1 changed files with 0 additions and 19 deletions

View File

@ -63,7 +63,6 @@ public class ExceptionUtilsTest extends TestCase {
private Throwable withCause;
private Throwable withoutCause;
private Throwable jdkNoCause;
private ExceptionWithCause selfCause;
private ExceptionWithCause cyclicCause;
public ExceptionUtilsTest(String name) {
@ -76,8 +75,6 @@ public void setUp() {
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 @@ protected void tearDown() throws Exception {
nested = null;
withCause = null;
jdkNoCause = null;
selfCause = null;
cyclicCause = null;
}
@ -157,7 +153,6 @@ public void testGetCause_Throwable() {
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 @@ public void testGetRootCause_Throwable() {
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 @@ public void testGetThrowableCount_Throwable() {
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 @@ public void testGetThrowables_Throwable_jdkNoCause() {
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 @@ public void testGetThrowableList_Throwable_jdkNoCause() {
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());