Open GoogleCodeExporter opened 8 years ago
As you mentioned to me offline, the way to do serialization-reflection on
Android is summed up here:
http://stackoverflow.com/questions/3121515/is-it-possible-to-bypass-constructors
-when-instantiating-objects-in-android
I was already investigating this and had got as far as needing to ask precisely
the question in the link above. Using the desktop version of
serialization-reflection, I already had a working prototype of Android Mock
that bypassed constructors so it should be a pretty straightforward task now to
sort it out permanently.
In the very short term, casting the null to an appropriate parameter will sort
matters out, but it's an ugly hack.
Original comment by swoodw...@google.com
on 2 Nov 2010 at 9:23
Casting doesn't work - it works in setting generic parameters (meaning if you
have a <T> in the method definition, it'll get set correctly, but you'll have
no way of passing the correct parameter to getConstructor).
What you'd need is something like this:
http://easymock.org/api/easymockclassextension/2.5.2/org/easymock/classextension
/IMockBuilder.html
That was contributed by us to easymock, btw - if you search the internal google
codebase you'll find the original MockBuilder too.
Original comment by rdama...@google.com
on 4 Nov 2010 at 11:22
Original issue reported on code.google.com by
rdama...@google.com
on 18 Aug 2010 at 6:15