> 
> hum ... normally each test case will trigger the Servlet redirector which
> will instantiate a new test class for each call, meaning that your "if(first
> time)" will always be true. Thus, you should not need it ! ... :)
> 

A subtlety I had missed. you are of course right. That could be a pain
if you ever need to do a lot of setup for a TestCase before executing
all the methods - it means the setup gets run every time.


> > It means I can run test cases assuming that the actionservlet has
> > started up and is available for use.
> >
> > Of course if your actionservlet doesn't start properly this method won't
> > work.
> >  Then all you need to do is write a testcase for each action that you
> > want to test.
> >
> > In your example, you could at least move the creation of the
> > actionservlet into the setUp method.
> >
> >
> > I guess the real issue with testing struts dispatcher based work, is
> > that you have an extra level of redirection to go through. At the moment
> > the ServletRedirector is set up to make calls to Servlet classes. with a
> 
> Actually, the servlet redirector is set up to make calls to any java class.

as long as the are an instance of ServletTestCase then yes... otherwise
no.


<snip>

Jari
--
Jari Worsley
Senior Programmer
Hyperlink Interactive Ltd

Reply via email to