Share

mocklib

Tracker: Bugs

5 Simplify MockObjectFactory#injectMock to only one interface - ID: 2596063
Last Update: Tracker Item Submitted ( bittwidler )

The new method added to the MockObjectFactory in r3-1-1 allows the
specification of multiple interface classes using the Java 1.5 ellipses
capability:
injectMock(Object objToInjectTo, String fieldToInjectTo,
Class ... interfaceToMock)

Want to remove the ellipses to just allow the specification of one
interface class for two reasons:
1) After thinking about it for a minute, I couldn't think of a scenario
where it would make sense to use this method with multiple interface
classes anyway. All cases it should just be implementing the single
interface that the MockObject is being injected into.
2) This isn't very 1.4 friendly so using the method requires the use of one
interface class to be wrapped with new Class[] {MyInterface.class}


Brian Freeman ( bittwidler ) - 2009-02-13 14:15

5

Open

None

Brian Freeman

JMockLib

r3-1-1

Public


Comments




Log in to comment.

No follow-up comments have been posted.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.