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:[EMAIL PROTECTED]]
> 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" <[EMAIL PROTECTED]>
> To: "Cactus Users List" <[EMAIL PROTECTED]>
> 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:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:cactus-user-
> [EMAIL PROTECTED]>
> 




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

Reply via email to