velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai <shinobu.ka...@gmail.com>
Subject Re: Junit and Debugging of Velocity Templates
Date Mon, 02 May 2005 18:54:56 GMT
Hi Llewellyn,

> I would like to know which flag to set so when I run my junit tests
> 
> #parse (fileWithErrorInIt)
> 
> $real.unknownfield.call()
> 
> #if ($real.unknowfield()) .... #end
> 
> $real.returnsNull().doSomething()
> 
> will all throw errors so my test will fail and I can realize I did something stupid.

You should be able to use a customary Introspector.  See the
"Pluggable Introspection" here:
    http://jakarta.apache.org/velocity/developer-guide.html#Velocity%20Configuration%20Keys%20and%20Values

But instead of doing all those tricky stuff, I suggest you read "JUnit
Recipes" by J. B. Rainsberger.  There is a nice recipe for testing
Velocity templates.
    http://www.amazon.com/exec/obidos/tg/detail/-/1932394230    

Best regards,
-- Shinobu

--
Shinobu Kawai <shinobu.kawai@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message