You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by nb...@apache.org on 2009/03/11 22:02:25 UTC
svn commit: r752611 -
/velocity/engine/branches/2.0_Exp/src/test/org/apache/velocity/test/BaseTestCase.java
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;
}