jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leos Literak <liter...@seznam.cz>
Subject Re: how to test jsp?
Date Sun, 15 Dec 2002 09:52:35 GMT
Vincent,

> I like your boss ... :-)

;-)

>>I'd like to stay with jsp, as they are easy to develope.
> You must the first one I hear saying that JSP are easy to develop! ;-)

well, I dont like and I dont use jsp for real development
of web application. But it is easy for tests as

1\ you dont need to create servlet and manuipulate web.xml
2\ they are automatically reloaded on change (yes, you CAN configure
the same for servlets)

> It looks complex to me... :-) If you want to use Cactus I would drop
> your JSPs and instead use Cactus ServletTestCase. Java classes can also

After some playing with cactus, I've decided to go this way.
When I started, I hadn't understood cactus well. I thought,
I will have to rewrite my jsp to servlet and then create
another ServletTestCase to call it.

e.g.

Cactus -> MyServletTestCase -> JspRewriteServlet

That's the reason, why I searched for some workaround.
Now I know, that it would be stupid. That I can move
all test logic into my ServletTestCase:

Cactus -> MyServletTestCase

and each jsp could be rewritten as method test ..

like

public void testTemplate() {
  // find context
  // lookup interfaces
  // create entity bean
  // search entity bean
  // assertEquals
}

If I found doc abour J2EE RI tests earlier, I could
have been finished with this rewrite already.

What about to create simple page, which will contain
developer use cases for cactus with links to correct
doc? This would shorten learn path for newbies like me.

e.g.

Are you

* developer of JSP tag libraries? Read on ..
* developer of servlet? Read on ..
* developer of EJBs? Read on this and this ..

Do you wish to
* integrate cactus into ant? Read on ..
* test cactus via web browser? Read on ..


>>jsp with browser interaction and when it is ready, just
 >
> Not sure what you mean here by browser interaction.
> 
> No :-) Have a look at
> http://jakarta.apache.org//cactus/howto_runner.html (section on running
> cactus tests in a browser).

oops, you're right. that's what I was thinking of. And I have already
read this doc, but I forgot it

>>My problem is, that there is no single line in documentation
>>describing, how to open URL with jsp. 
> This is Servlet/JSP API, not Cactus! Even though, it is documented in
> Cactus... (see below).
 > Hum.. You said you read all the doc... Have you read this one:
 > http://jakarta.apache.org//cactus/howto_jsp.html which explains what

I missed it. Quite elegant:

RequestDispatcher rd = theConfig.getServletContext().
getRequestDispatcher("/path/to/test.jsp");
rd.forward(theRequest, theResponse);

Thanks for all hints.

	Leos

-- 
Leos Literak
http://AbcLinuxu.cz - tady je tucnakum hej!




--
To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>


Mime
View raw message