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:
parent
ad36e20222
commit
178e551ddb
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue