Hi Phil!

Phil Magill wrote:
> Because of the client and sever aspects of cactus i've had to create Proxy
> Objects for each EJB. These Proxy Objects create the EJB and call the
> methods. Its a one to one method mapping. These ProxyObjects are on the
> class path for App Server and the cactus client. In the testEJBMethod in
> your test case, create the proxy object, this will also create an object on
> the server and then the JNDI ref can be resolved.

Aaargh!!! Ignorance has betrapped me again!

I didn't know about the Proxy class, and so I embarked in a very strange
way to do the same thing.

Short explanation: create a mock Bean, compile into a .class, then use a
custom ClassLoader to modify its behavior at runtime (changing ClassFile
entries).

Heck! Proxies allow for a much sharper implementation.

> PS If there is a better way OR I missed something fundamental with Cactus
> let me know.

I also created a mock InitialContextFactory and a mock Context. They
seem to work ok.

Un saludo,

Alex.

Reply via email to