jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@octo.com>
Subject RE: Running cactus in a separate tree from source
Date Tue, 23 Apr 2002 19:19:30 GMT

I hope you'll submit some FAQ entries after all these questions ! :-)

> -----Original Message-----
> From: laurent.duperval@masq.ca [mailto:laurent.duperval@masq.ca]
> Sent: 23 April 2002 19:54
> To: cactus-user@jakarta.apache.org
> Subject: Re: Running cactus in a separate tree from source
> On 23 Apr, To: Cactus Mailing List wrote:
> > Hi,
> >
> > We have a setup which generates a lot of war files in
> >
> > /tmp/foo/foo.war
> > /tmp/bar/bar.war
> > .
> > .
> > .
> >
> > I want to create some tests for Cactus which tests the classes in
> above
> > wars. I was hoping that I could put all my tests in a cactus.war
> and
> > run the tests correclty. Is this possible? Or do I have to have all
> tests
> > in the foo.war, bar.war, etc. files? Should I try to use an EAR file
> my
> > cactus tests?
> >
> Ok, turns out that this question is valid after all. I have a number
> jars and Web apps that have been built by our build script. Each
> application
> is deployed it its own archive. I would like to put all the cactus
> in
> one archive, instead of spreading them out in each of the archives as
> outlined earlier? Is this possible? Should I do that using an EAR
> will
> contain the war file for my cactus tests and a bunch of jar and/or ear
> files
> which contain the classes I want to test? Or is there a better way?

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

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

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

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


> Thanks,
> L
> --
> Laurent Duperval <mailto:laurent.duperval@masq.ca>
>     The components you have will expand to fill the available space.
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-user-
> help@jakarta.apache.org>

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