On Oct 2, 2006, at 4:26 PM, Jeremy Boynes wrote:

On Oct 2, 2006, at 3:49 PM, Ignacio Silva-Lepe wrote:

Ah, if only test cases were that simple ... :-)

If it isn't simple to unit test that generally indicates we have a broader problem - e.g. lack of separation of concerns.
As it turns out, CompositeReference (as an extension of ReferenceExtension) needs to pass a reference interface class to its parent ctor, which seems most appropriately obtained from the service contract it is given. This does not seem to be very generic, not mention the fact that ServiceContract is an abstract class, not an interface and not directly instantiable either, so the test case cannot be very generic either.

So much for that, thoughts?

Use a private inner class to mock out ServiceContract? Use EasyMock class extension to generate a instantiable version of ServiceContract? Make ServiceContract an interface?

Probably should use the inner class approach but I've also found EasyMock to be useful in mocking out classes as well through its extension package.
But more fundamentally, why does ReferenceExtension need a Java interface class - shouldn't it be using a ServiceContract?
Yea this seems a bit strange. It should only require one when generating proxies.

--
Jeremy


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



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

Reply via email to