You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Bill Laird <wl...@wildfire.com> on 2002/01/28 20:32:10 UTC

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Cactus as functional test tool

Posted by Vincent Massol <vm...@octo.com>.
Bill,

Go ahead if you wish to patch Cactus for your need. At this point I
wouldn't want to deviate from the base JUnit. However we could host your
extension on the cactus web site, under an extension page if you wish.

Thanks
-Vincent

> -----Original Message-----
> From: Bill Laird [mailto:wlaird@wildfire.com]
> Sent: 07 February 2002 17:19
> To: Cactus Users List
> Subject: Re: Cactus as functional test tool
> 
> 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" <vm...@octo.com>
> To: "'Cactus Users List'" <ca...@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" <wl...@wildfire.com>
> > > To: "Cactus Users List" <ca...@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:
> > > <ma...@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > > <ma...@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:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Cactus as functional test tool

Posted by Bill Laird <wl...@wildfire.com>.
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" <vm...@octo.com>
To: "'Cactus Users List'" <ca...@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" <wl...@wildfire.com>
> > To: "Cactus Users List" <ca...@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:
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@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:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Cactus as functional test tool

Posted by Vincent Massol <vm...@octo.com>.
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" <wl...@wildfire.com>
> To: "Cactus Users List" <ca...@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:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Cactus as functional test tool

Posted by Bill Laird <wl...@wildfire.com>.
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" <wl...@wildfire.com>
To: "Cactus Users List" <ca...@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:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Cactus as functional test tool

Posted by Bill Laird <wl...@wildfire.com>.
Latka looks like a great tool for driving testing from HTTP test clients.
However, my test requirements are to run in container - doing API level
testing of EJB's. Therefore, Latka is not a good solution. I like everything
cactus does, except I want to use the dynamic proxy version of junit.jar to
allow parameterization to the junit testXXX methods. Guess I'll have to find
out empirically. Will let you know!! ;-)

Cheers,
Bill

----- Original Message -----
From: "Erik Hatcher" <li...@ehatchersolutions.com>
To: "Cactus Users List" <ca...@jakarta.apache.org>
Sent: Monday, January 28, 2002 11:08 PM
Subject: Re: Cactus as functional test tool


> How about Latka instead?
>
>     http://jakarta.apache.org/commons/latka/index.html
>
>
> ----- Original Message -----
> From: "Bill Laird" <wl...@wildfire.com>
> To: "Cactus Users List" <ca...@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:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Cactus as functional test tool

Posted by Erik Hatcher <li...@ehatchersolutions.com>.
How about Latka instead?

    http://jakarta.apache.org/commons/latka/index.html


----- Original Message -----
From: "Bill Laird" <wl...@wildfire.com>
To: "Cactus Users List" <ca...@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:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>