-----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]



Reply via email to