>Jeffrey D. Brekke:
>If you have Turbine started you may be able to create a RunData via the
>RunDataService singleton. You may have to mock the http response and
>request though. I'm not so sure how that would work. Is there a way you
>can unit test your code without requiring TemplateLink and a fully
populated
>RunData?
>It looks from your test class name that you are testing a tool which
extends
>TemplateLink. Turbine sometimes doesn't make it real easy to unit test,
ala
>the feeling you need to mock objects.
>
>Another option for testing of this type may be Apache/Cactus (
>jakarta.apache.org/cactus ). This will startup Turbine in the servlet
>container, allow you to create a real RunData from a request/response and
>still unit test.
Thanks for the reply.
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 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.
Thanks again,
Chris
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>