unwrapping is no longer necessary, now that macrodef and TaskAdapter pass the exceptions unchanged

git-svn-id: https://svn.apache.org/repos/asf/ant/antlibs/antunit/trunk@442854 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Bodewig 2006-09-13 05:27:07 +00:00
parent ad36e20222
commit 178e551ddb
1 changed files with 3 additions and 14 deletions

View File

@ -152,20 +152,9 @@ public class AssertTest extends BuildFileTest {
fail("Expected failed assetion");
} catch (AssertionFailedException e) {
assertEquals(message, e.getMessage());
} catch (BuildException e) {
// depending on the number of macrodef indirections, this
// can become arbitrarily deep
while (true) {
Throwable t = e.getCause();
assertNotNull(t);
assertTrue("nested is a BuildException",
t instanceof BuildException);
if (t instanceof AssertionFailedException) {
assertEquals(message, e.getMessage());
break;
}
e = (BuildException) t;
}
} catch (Throwable t) {
fail("Unexpected exception of type " + t.getClass()
+ ", message '" + t.getMessage() + "'");
} // end of try-catch
}
}