You'll have to dig through the SingletonProxy to get to the EJBProxy.

Most of the code that generates classes is careful to work around
toString().  The  logic for this is part of the MethodIterator.  This
may be a minor bug in EJBProxyFactory, but toString() is generally not
a valid EJB method (it certainly doesn't throw RemoteException).


On Thu, 03 Feb 2005 17:15:49 -0600, Brian K. Wallace
<[EMAIL PROTECTED]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Continuing on through understanding what happens when...
> 
> Looking at TestEJBProxyFactory, one portion of the code that was never
> tested was an implementation that already had a toString() method. I
> added one. This covered that case - verified with an assertEquals() on
> the object.toString() - that if a class already had a toString() method,
> it wouldn't try to add another one.
> 
> What I found, however, was in going back to verify the original
> toString() returned what I thought it should. Since the
> 'addToStringMethod' was being called (3 times), I looked at the code for
> that which does the following:
> ~  ClassFabUtils.addToStringMethod(classFab,
> ImplMessages.ejbProxyDescription(serviceId, serviceInterface, jndiName));
> 
> Since ImplMessages isn't visible, I created a
> MessagesUtil.getEjbProxyDescription(...) method taking the same
> parameters and returning what should be passed to addToStringMethod(...).
> 
> To the testEJBProxy() method, I then added:
> 
> assertEquals(MessagesUtil.getEjbProxyDescription("hivemind.test.lib.SimpleRemote",
> SimpleRemote.class, "hivemind.test.lib.Simple"), object.toString());
> 
> This assertion fails.
> 
> I added a debug to the addToStringMethod(...) to verify I was using the
> right values, then printed out the object's toString() and what's
> returned from my MessagesUtil method. What I got was the following:
> 
> Service Id: hivemind.test.lib.SimpleRemote, ServiceInterface: interface
> hivemind.test.lib.SimpleRemote, JNDI: hivemind.test.lib.Simple
> SimpleRemote toString: <SingletonProxy for
> hivemind.test.lib.SimpleRemote(hivemind.test.lib.SimpleRemote)>
> MessageUtil  toString: <EJBProxy for
> SimpleRemote(hivemind.test.lib.SimpleRemote) at hivemind.test.lib.Simple>
> 
> The toString() actually added to the class is from SingletonProxy, not
> EJBProxy. I'm willing to bet I'm missing something, but I'm at a loss as
> to what. Am I missing it? Or is this a bug somewhere?
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.5 (MingW32)
> 
> iD8DBQFCArClaCoPKRow/gARAoFCAKDFN9ugluoWe3WHSwL51oNDreje/ACghmOB
> EadZI1Xw2PzjxnDixuh0YD8=
> =JugS
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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

Reply via email to