> -----Original Message-----
> From: Chris K Chew [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 25, 2002 5:46 PM
> To: Turbine Users List
> Subject: RE: Set up RunData in Junit Tests?
[SNIPPED]
> My tool is extending TemplateLink to provide convenience
> methods. After
> five links like:
>
> $link.setPage("schedules,ProfessionalDay.vm").addPathInfo("p",
> $prof).addPath
> Info("d",$date)
>
> I decided that I really needed to isolate link-generation and
> request-info-gathering. So I consolidated by creating methods like
> "linkProfessionalDay(Professional, Date)".
>
> But if nobody knows how to test an extension of TemplateLink, should I
> assume most people have other approaches for organizing
> intra-application
> links? Any Suggestions? I imagine many people use velocity macros.
I think this is nice solution. Maybe not extending TemplateLink, but using
the Decorator pattern or aggregation of a TemplateLink object in your pull
tool would be sufficent to test what you need to test? We've used macros
but mostly (shudder) have left the duplication in our templates ( something
I would not recommend ). For some reason we don't actively refactor our
templates let alone remove duplication. Thanks for sharing your reasoning,
I'll have to remember this the next time I'm into my templates and see what
duplication I come across.
> I will try mocking HTTPResponse and HTTPRequest for curiosity
> sake. I am
> also thinking that it is time to set up
> integration/functional tests with
> cactus or httpUnit. I had been avoiding this until my
> template framework
> matured a little more.
Please let us know of your results or if you want to write up a little tip
or how-to I'll add it to the Application Testing page. I know HttpUnit also
has a ServletUnit thingy for testing servlets without a container, but I
haven't looked at it much yet. It may prove to be a lighter solution than
cactus for unit testing. Good luck!
=================================================================
Jeffrey D. Brekke Quad/Graphics
[EMAIL PROTECTED] http://www.qg.com
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>