You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2006/09/13 07:27:07 UTC

svn commit: r442854 - /ant/antlibs/antunit/trunk/src/tests/junit/org/apache/ant/antunit/AssertTest.java

Author: bodewig
Date: Tue Sep 12 22:27:07 2006
New Revision: 442854

URL: http://svn.apache.org/viewvc?view=rev&rev=442854
Log:
unwrapping is no longer necessary, now that macrodef and TaskAdapter pass the exceptions unchanged

Modified:
    ant/antlibs/antunit/trunk/src/tests/junit/org/apache/ant/antunit/AssertTest.java

Modified: ant/antlibs/antunit/trunk/src/tests/junit/org/apache/ant/antunit/AssertTest.java
URL: http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/src/tests/junit/org/apache/ant/antunit/AssertTest.java?view=diff&rev=442854&r1=442853&r2=442854
==============================================================================
--- ant/antlibs/antunit/trunk/src/tests/junit/org/apache/ant/antunit/AssertTest.java (original)
+++ ant/antlibs/antunit/trunk/src/tests/junit/org/apache/ant/antunit/AssertTest.java Tue Sep 12 22:27:07 2006
@@ -152,20 +152,9 @@
             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
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org