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
Laurent,

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
the
> above
> > wars. I was hoping that I could put all my tests in a cactus.war
file
> and
> > run the tests correclty. Is this possible? Or do I have to have all
my
> tests
> > in the foo.war, bar.war, etc. files? Should I try to use an EAR file
for
> my
> > cactus tests?
> >
> 
> Ok, turns out that this question is valid after all. I have a number
of
> EJB
> 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
tests
> 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
which
> 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
webapp.

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 ?

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).

Thanks
-Vincent

> Thanks,
> 
> L
> 
> --
> Laurent Duperval <mailto:laurent.duperval@masq.ca>
> 
> PARKINSON'S LAW, MODIFIED
>     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>


Mime
View raw message