Daniel Fagerstrom wrote:
Sylvain Wallez wrote:
Upayavira wrote:
Or unit/functional. That's actually the distinction isn't it?
Yep. That definitely sounds better.
But after more thinking I not sure we actually _need_ to make the distinction: what about having HtmlUnitTestCase create upon first use an embedded Jetty running Cocoon? This way we don't need to run it separately and the process can be completely automated.
The only problem may be to find an available port (8888 may not be always available) but it's fairly easy to find one before starting the servlet engine on that port.
Thoughts?
It doesn't solve the problem at hand, but it is possible to do functional testing of Cocoon without servlet. I have started to build some functionallity for that, that I'm using during VPC development. See src/test/org/apache/cocoon/SitemapTestCase.java and examples under generation.
This far I'm using the MockEnvironment, but it needs to be developed for making it usable in more cases.
As Cocoon is supposed to be environment independent I think it is better to do functional testing without servlets. It also simplifies testing to not have to start a servlet.
I had this idea also for "intermediate-level" functional tests, but HtmlUnit seems to be intimately tied to an HTTP stack, and not using it would mean rewriting all of its nice features.
Maybe we can work with the HtmlUnit folks so that they use an abstract request/response API...
Sylvain
-- Sylvain Wallez Anyware Technologies http://apache.org/~sylvain http://anyware-tech.com Apache Software Foundation Member Research & Technology Director
