Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.5.1
-
Fix Version/s: None
-
Component/s: JMock 2.x.x Library
-
Labels:None
-
Number of attachments :
Description
I had a need to imposterise concrete classes (from 3rd-party jars) with final toString() method.
For background, please see discussion at:
http://www.nabble.com/Re%3A-mocking-concrete-classes-with-final-toString-method-p18509146.html
In that thread, Nat had advised one of the options as being "write your own Imposteriser".
So, for my needs I ended up writing ClassImposteriserAllowingFinalToString. It would be great if ClassImposteriser could be made easier to extend. As it is, it has a lot of private methods and properties and I pretty much had to rewrite my own imposteriser from scratch (essentially duplicating the private pieces of ClassImposteriser). If ClassImposteriser was extension friendly, I would probably need to do minimal work by writing my own imposterise() and canImposterise() methods. This way I would also be safeguarded against future bug-fixes that may happen in ClassImposteriser.
Cheers and thanks in advance.
Patch against trunk allowing ClassImposteriser to be extended.