Thanks for taking the time to investigate the problem.
I'll try your test this evening with the new version of unitils.
I refactored a large part of the mocking framework and it should normally also handle the object creation now.
There are some limitations however:
There has to be a default constructor (can be private or can be implicit when there is no constructor defined).
I've searched the bytecode for a way to call the initializers without calling a constructor, but that does not seem to be possible in Java.
I even tried to generate a new class and inject an empty default constructor, but no luck.
So if there is no default constructor, you cannot create an initialized version of a partial mock (a warning is logged)
The new version is comming out soon. I'm doing some last tests and I'm setting up a wiki with some code samples (I'm still looking for more samples and ideas)
http://sourceforge.net/apps/mediawiki/unitils/index.php?title=Main_Page
thanks for the support,
I'll let you know the outcome of the test
Grtz,
Tim
The NPR we get is because the constructor on the object being mocked is not being called.