Author: nbubna
Date: Wed Mar 11 21:02:25 2009
New Revision: 752611

URL: http://svn.apache.org/viewvc?rev=752611&view=rev
Log:
make assertEvalException more informative when debugging

Modified:
    
velocity/engine/branches/2.0_Exp/src/test/org/apache/velocity/test/BaseTestCase.java

Modified: 
velocity/engine/branches/2.0_Exp/src/test/org/apache/velocity/test/BaseTestCase.java
URL: 
http://svn.apache.org/viewvc/velocity/engine/branches/2.0_Exp/src/test/org/apache/velocity/test/BaseTestCase.java?rev=752611&r1=752610&r2=752611&view=diff
==============================================================================
--- 
velocity/engine/branches/2.0_Exp/src/test/org/apache/velocity/test/BaseTestCase.java
 (original)
+++ 
velocity/engine/branches/2.0_Exp/src/test/org/apache/velocity/test/BaseTestCase.java
 Wed Mar 11 21:02:25 2009
@@ -245,14 +245,22 @@
             {
                 info("Expectation: "+exceptionType.getName());
             }
+            else
+            {
+                info("Expectation: "+Exception.class.getName());
+            }
             evaluate(evil);
-            fail("Template '"+evil+"' should have thrown an exception.");
+            String msg = "Template '"+evil+"' should have thrown an 
exception.";
+            info("Fail: "+msg);
+            fail(msg);
         }
         catch (Exception e)
         {
             if (exceptionType != null && 
!exceptionType.isAssignableFrom(e.getClass()))
             {
-                fail("Was expecting template '"+evil+"' to throw 
"+exceptionType+" not "+e);
+                String msg = "Was expecting template '"+evil+"' to throw 
"+exceptionType+" not "+e;
+                info("Fail: "+msg);
+                fail(msg);
             }
             return e;
         }


Reply via email to