jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@pivolis.com>
Subject RE: cactus newbie / EJB
Date Wed, 17 Sep 2003 05:57:54 GMT
Hi Nathan,

> -----Original Message-----
> From: Nathan Coast [mailto:nathan@codeczar.com]
> Sent: 17 September 2003 07:53
> To: cactus-user@jakarta.apache.org
> Subject: cactus newbie / EJB
> 
> Hi,
> 
> just had a quick browse around cactus docs and AFAICT, to test ejbs
> within a container, you have to create and deploy a cactus webapp that
> executes the ejb code.  Is this correct?  Are there alternative ways
of
> executing tests?  E.g. from a remote client to some deployed test
cases?

True. This is a current limitation. Please have a look at
http://cvs.apache.org/viewcvs.cgi/jakarta-cactus/samples/ejb/src/scripts
/share/build.xml?rev=1.2&content-type=text/vnd.viewcvs-markup to see how
to do that in an Ant build file.

> 
> I followed some cactus-user threads that mentioned an EJB Redirector
>
http://www.mail-archive.com/cactus-user@jakarta.apache.org/msg03049.html
> back in February.  Has any progress been made with this?  

Some but not much. Siddhartha sent an EJB redirector proto but as it's
not against CVS HEAD I could not apply it easily. Also, it wasn't
finished/working. Having this EJB redirector will be one of our main
goal for Cactus 1.6

> How yould you
> execute tests using the redirector?

Same as with the other redirector. Actually there will be possibly be
several redirectors. One SessionBeanRedirector, one
MessageDrivenBeanRedirector, one EntityBeanRedirector, etc. Cactus
client-side will transparently connect to it using RMI/IIOP, JMS, etc.

As a user, you'll simply do:

public MyTest extends SessionBeanTestCase
{
    public void testXXX()
    {
       MyEJB ejb = new MyEJB();
       ejb.setSessionBeanContext(context);<- provided by
SessionBeanTestCase
       [...]
    }
}

-Vincent


Mime
View raw message