ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r442854 - /ant/antlibs/antunit/trunk/src/tests/junit/org/apache/ant/antunit/AssertTest.java
Date Wed, 13 Sep 2006 05:27:07 GMT
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


Mime
View raw message