cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Fagerstrom <>
Subject Re: [M10N] Time to finish
Date Thu, 05 Jan 2006 13:13:01 GMT
Bertrand Delacretaz wrote:

> Le 5 janv. 06, à 11:40, Daniel Fagerstrom a écrit :
>> ...IIRC, all Cocoon with blocks included, where possible to build 
>> with M2 a couple of months ago. Now just the core is built from the 
>> main POM. What is needed for building everything and create a working 
>> webapp?..
> I haven't been able to test  the Maven stuff lately, but I'd like to 
> mention that the HtmlUnit tests will need to run under Maven once 
> they're ported to 2.2.
> Currently in 2.1x you need to start an instance of Cocoon with 
>, and run another JVM with " htmlunit-tests".
> I've seen some code (from Daniel IIRC) fly by, which uses a more 
> integrated testing method, starting the servlet under test in the same 
> JVM,

I have used functional testing at the Processor level for developing 
virtual sitemap components and blocks (o.a.c.test.SitemapTestCase). Now 
when I'm refactoring the block architecture to use Servlet instead of 
Processor I'm using ServletUnit from HttpUnit instead 
(o.a.c.test.ServletTestCase). Unfortunally ServletUnit sucks for my 
needs. It is rather inflexible in the setup, the code is complicated for 
what it does (might be coupled to needs in HttpUnit) and it silently 
swallow all servlet log messages and internal stack traces. So when 
things go wrong during development there are signs on what happened :/

IMO we need functional tests on the "controller" level, especially if we 
are going to make controllers first class citicens. For ServletUnit we 
either need to fix it so that it gives decent log messages and stack 
traces or develop our own.

> but I don't know what the preferred way is with Maven. Of course, the 
> 2.1.x way of running these tests is not suitable to automated 
> continuous integration.

I have found it very practical to test Processor and Servlet in an 
"embeded" environment. Something similar is possible for HtmlUnit, it 
has a hook (which is documented as unstable and for internal use :/ ) so 
that one can connect it directly to a Processor or Servlet (with 
appropriate environment setup) in the same VM.

> Dunno how much impact this has on the Maven stuff,

We should start by replacing Ant, new features can be added later.

> just wanted to make sure this is not forgotten. And if someone has 
> pointers on how to do this the right way, I hope to find some time to 
> port these tests to 2.2. at some point.

Great! I don't know "the right way", but I certainly have opinions ;)


View raw message