jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From laurent.duper...@masq.ca
Subject Re: Running cactus in a separate tree from source
Date Wed, 24 Apr 2002 13:21:03 GMT
On 23 Apr, Vincent Massol wrote:
> Laurent,
> I hope you'll submit some FAQ entries after all these questions ! :-)

Sure, if that can help.

> The constraint is not Cactus. It is your container classloader. Once you
> understand that you understand all valid possibilities. However, it is a
> bit tricky to understand ... :-)
> The one thing that would not work is if you put the Cactus tests in one
> J2EE module and the classes to test in another. This is because Cactus
> needs a Redirector (let's say a servlet). Let's say you configure Cactus
> web.xml in a cactus.war module and that your application is in
> myapp1.war. I think the J2EE spec says that a webapp is independent of
> another one and thus they're not supposed to share the same classloader.
> Thus it is impossible to view the classes in one webapp from another
> webapp.

Ok, I can dig that.

> What Cactus 1.3 should support (if your container supports Context
> classloaders) is to be put in the your container system classpath (I
> haven't tried it though) so that you can "share" cactus.jar for several
> webapps.


> Your underlying question, if I understand correctly is : how do I test
> several webapps ?

Right. But with a twist: I'd like to keep the cactus stuff separate from the
source code. Our source code structure looks like this:


In cactus, I want to put all the code to do the cactus tests.

> The solution :
> - Have several <junit> tasks and use several "cactus.properties" files
> (you can pass them to Cactus using the cactus.config java parameter (See
> http://jakarta.apache.org/cactus/howto_config.html).

So I am stuck with having to intersperse the cactus tests with the code,
right? Each WebApp needs its deployment descriptor to operate properly,
right? So I will have to put the cactus code with the rest of the code, so
that the Webapp will be constructed correctly. ... I don't really see a way
around it. I wanted to keep the cactus code from being deployed with the
production code, without having to do a lot of gymnastics. 

The <junit> thing you're talking about is taken care of by the way our code
is structured. Probably what I'll need to do is to start Weblogic from my
toplevel build.xml, then the runtests target will run the tests in each of
the modules, and then it will stop weblogic in the toplevel build file.

If there's another way, let me know.

Thanks for the reply,


Laurent Duperval <mailto:laurent.duperval@masq.ca>

"When women say they love you just the way you are, they really mean it...
then they try to change you."
                     -Paraphrased from "Coach"

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

View raw message