jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Laird" <wla...@wildfire.com>
Subject Re: Cactus as functional test tool
Date Thu, 07 Feb 2002 17:18:48 GMT
Hey Vincent. Thanks for the pointer. I am totally brand new to Cactus, so
any pointers in the area of where to customize are of great value. Without
looking at the implementation of the Cactus testcase extension, based on
your snippet, it looks as
if perhaps a simple reorganization around the code that does a match on
no-arg test methods would do the trick.

Thoughts?

Cheers,
Bill


----- Original Message -----
From: "Vincent Massol" <vmassol@octo.com>
To: "'Cactus Users List'" <cactus-user@jakarta.apache.org>
Sent: Friday, February 01, 2002 2:14 PM
Subject: RE: Cactus as functional test tool


> Bill,
>
> I have not had the time yet to completely review the additions to JUnit
> discussed at http://www.gnufoo.org/junit/index.html. However, I don't
> believe they will work with Cactus as is.
>
> Here is the contract between Cactus and JUnit :
> - Cactus test cases extend JUnit TestCase
> - Any JUnit TestRunner should work with Cactus
>
> However it seems that one problem is the call of the testXXX() methods.
> "JUnit featuring dynamic proxies" mentions the ability to call a test
> method that accepts parameters. Currently this call is made by Cactus
> TestCase extension :
>
>     protected void runServerTest() throws Throwable
>     {
>         Method runMethod = null;
>         try {
>             // use getMethod to get all public inherited
>             // methods. getDeclaredMethods returns all
>             // methods of this class but excludes the
>             // inherited ones.
>             runMethod =
> getClass().getMethod(this.getCurrentTestMethod(),
>                 new Class[0]);
>
>         } catch (NoSuchMethodException e) {
>             fail("Method [" + this.getCurrentTestMethod() +
>                 "()] does not exist for class [" +
>                 this.getClass().getName() + "].");
>         }
>         if (runMethod != null &&
> !Modifier.isPublic(runMethod.getModifiers())) {
>             fail("Method [" + this.getCurrentTestMethod() +
>                 "()] should be public");
>         }
>
>         try {
>             runMethod.invoke(this, new Class[0]);
>         }
>         catch (InvocationTargetException e) {
>             e.fillInStackTrace();
>             throw e.getTargetException();
>         }
>         catch (IllegalAccessException e) {
>             e.fillInStackTrace();
>             throw e;
>         }
>     }
>
> thus it won't accept parameters. In the same spirit that Shane has
> provided a patch to JUnit, you'll also need to provide a patch to Cactus
> (at least a patch to the above code but probably more).
>
> Hope it helps.
> -Vincent
>
> > -----Original Message-----
> > From: Bill Laird [mailto:wlaird@wildfire.com]
> > Sent: 28 January 2002 19:39
> > To: Cactus Users List
> > Subject: Re: Cactus as functional test tool
> >
> > Sorry for the awful formatting on that last message guys. Let me
> rephrase
> > the question at hand. Will I be able to 'plug and play' versions of
> junit
> > with cactus? Specifically, the one modified for the dynamic proxy
> > interfaces
> > at http://www.gnufoo.org/junit/index.html .
> >
> > Regards,
> > Bill Laird
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "Bill Laird" <wlaird@wildfire.com>
> > To: "Cactus Users List" <cactus-user@jakarta.apache.org>
> > Sent: Monday, January 28, 2002 2:32 PM
> > Subject: Cactus as functional test tool
> >
> >
> > > Hello - what are your thoughts on using Cactus as a functional test
> > tool?
> > > I'm thinking about using cactus as a functional test tool. To
> accomplish
> > > this task, I need Junit tests that accept arguements. To accomplish
> > this,
> > I
> > > am thinking of using the Junit featuring dynamic extensions. (see
> > > http://www.gnufoo.org/junit/index.html ) . I'm wondering if the
> dynamic
> > > extension mechanism will work with the cactus architecture.
> > >
> > > Thoughts?
> > >
> > > THanks,
> > > Bill Laird
> > >
> > >
> > > --
> > > 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>
> >
>
>
>
>
> --
> 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