Hi:

I'm reviewing approachs of how to build a J2EE  test
WAR component that houses "Cactus, JUnit and Log4j
jars"  that could be part of an EAR component . Using
this approach one cpold set roles and rules. This
approach should simplify testing of J2EE components.

In addition I developing a J2EE component testing best
practice, using the above approach.

Cheers
David L. Wasler
[EMAIL PROTECTED]      

--- Vincent Massol <[EMAIL PROTECTED]> wrote:
> Yes, Nicholas and David are right, you have a
> problem of location of
> jar. Each webapp is completely independent of
> another one in term of
> classloading. In other words you cannot put the
> Cactus framework in a
> separate WAR; it needs to be in the war where you
> test classes AND
> classes under test are located, as in :
> 
> lance.war
>  |_ WEB-INF/lib
>    |_ cactus.jar
>    |_ junit.jar
>    |_ struts.jar
>  |_ WEB-INF/classes
>    |_ classes under test + test classes
>  |_ WEB_INF/web.xml
> 
> Note 1: Do not provide servlet.jar as it is provided
> by your application
> server (by weblogic.jar in the case of weblogic).
> 
> Note 2: I don't understand the sentence "whose
> properties map to
> WEB-INF/lib"
> 
> -Vincent
> 
> > -----Original Message-----
> > From: Pavan Aripirala Venkata
> [mailto:[EMAIL PROTECTED]]
> > Sent: 14 December 2001 19:17
> > To: Cactus Users List
> > Subject: RE: Cactus : Struts
> > 
> >     I have cactus.jar, junit.jar and servlet.jar in
> WEB_INF/lib
> > directory. Actually in a war file called
> cactus_lance.war file. This
> war
> > file also contains the Cactus and struts test
> classes.
> >     There is a another war file - lance.war - which
> contains
> > struts.jar file, whose properties map to
> WEB_INF/lib. The actual
> classes
> > to be tested are present in this war file. This
> web.xml file in this
> war
> > file contains the Redirector mappings.
> >     All the above is w.r.t server. On the client end
> - struts.jar,
> > cactus.jar, httpclient.jar and the directory
> containing
> > cactus.properties file in the classpath and this
> classpath is
> specified
> > through the ant scripts and therefore are not in
> the system classpath.
> >     System classpath has none of the jar files or
> even our product
> > classes. Everything is specified in ant. All that
> is there in the
> system
> > classpath is the weblogic home, java home and ant
> home.
> > Hopefully this info suffices.
> > Thanks Vincent
> > 
> > Pavan.
> > 
> > 
> > -----Original Message-----
> > From: Vincent Massol [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, December 13, 2001 10:59 AM
> > To: 'Cactus Users List'
> > Subject: RE: Cactus : Struts
> > 
> > 
> > You need to be more precise. Where is the
> struts.jar located _exactly_
> > and where are the cactus.jar, junit.jar ? Do you
> have any jar in the
> > system classpath and if so, which ones ?
> > 
> > It seems your problem is related to classloaders,
> which is why I'm
> > asking these questions.
> > 
> > thanks
> > -Vincent
> > 
> > > -----Original Message-----
> > > From: Pavan Aripirala Venkata
> [mailto:[EMAIL PROTECTED]]
> > > Sent: 13 December 2001 18:26
> > > To: Cactus Users List
> > > Subject: RE: Cactus : Struts
> > >
> > >     Yes all the related jar files are in the
> classpath or in
> > WEB-INF/lib
> > > directory. The only jar I added is the
> Struts.jar file.
> > >
> > > Pavan.
> > >
> > >
> > > -----Original Message-----
> > > From: Vincent Massol [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, December 12, 2001 2:40 PM
> > > To: 'Cactus Users List'
> > > Subject: RE: Cactus : Struts
> > >
> > >
> > > Hi Pavan,
> > >
> > > Hum ... not sure what is happening here. Are you
> sure that struts or
> > any
> > > other jar is not in your weblogic system
> classpath ?
> > >
> > > -Vincent
> > >
> > > > -----Original Message-----
> > > > From: Pavan Aripirala Venkata
> [mailto:[EMAIL PROTECTED]]
> > > > Sent: 11 December 2001 00:24
> > > > To: Cactus Users List
> > > > Subject: RE: Cactus : Struts
> > > >
> > > >         Hi I used the StrutsTestCase.java to test one
> of my struts
> > > > class. I have struts.jar file in WEB-INF/lib
> directory of weblogic
> > 6.0
> > > > server. I am getting the following exception
> in the setUp() method
> :
> > > >
> > > >      [java] java.lang.NoClassDefFoundError:
> > > > org/apache/struts/action/ActionFormBeans
> > > >      [java]     at
> > > >
>
com.ejemoni.qa.struts.TestLogonStrut.setUp(TestLogonStrut.java:93)
> > > >      [java]     at
> > > >
> > >
> >
>
org.apache.cactus.AbstractTestCase.runBareServerTest(AbstractTestCase.ja
> > > > va:454)
> > > >      [java]     at
> > > >
> > >
> >
>
org.apache.cactus.server.AbstractTestCaller.doTest(AbstractTestCaller.ja
> > > > va:137)
> > > >      [java]     at
> > > >
>
org.apache.cactus.server.AbstractTestController.handleRequest
> > > > (AbstractTestController.java:122)
> > > >      [java]     at
> > > >
>
org.apache.cactus.server.ServletTestRedirector.doPost(Servlet
> > > > TestRedirector.java:134)
> > > >
> > > > At this line
> > > >         ActionFormBeans formBeans =
> > > >                   (ActionFormBeans)
> > > > context.getAttribute(Action.FORM_BEANS_KEY);
> > > >
> > > > If I do
> > > >         Object tmpObj =
> context.getAttribute(Action.FORM_BEANS_KEY);
> > > > and if I print this object, it is showing that
> the type of object
> is
> > > > org.apache.struts.action.ActionFormBeans
> > > > but however if I cast it
> > > >         ActionFormBeans formBeans =
> > > >                   (ActionFormBeans) tmpObj;
> > > > then again the above exception is being thrown
> > > >         I am able to run the EJB tests using cactus,
> but I am unable to
> > > > run the tests for struts. Could someone please
> help me in this
> > regard?
> > > > Thanks
> > > >
> > > > Pavan.
> > > >
> > > > -----Original Message-----
> > > > From: Erik Hatcher
> [mailto:[EMAIL PROTECTED]]
> > > > Sent: Friday, November 09, 2001 1:51 PM
> > > > To: [EMAIL PROTECTED]
> > > > Cc: [EMAIL PROTECTED]
> > > > Subject: Re: Cactus : Struts
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to