java.lang.IllegalArgumentException: Cannot subclass final class class

1,395 views
Skip to first unread message

GuruDutta

unread,
Dec 10, 2010, 11:44:40 AM12/10/10
to PowerMock
Hi,

I saw the previous post but my query was different.

I am using EasyMock and that being said
I get this error when I use EasyMock.createMock on a final class.
Also note that I used the EasyMock class extensions but it didn't help
and also the API's were deprecated.

Could you tell me as to how to mock a final class using easy mock.
Or should I use the jdave-unfinalizer jars (which I cant download from
JDave since the link is broken) or use JavaAssit which manipulates the
bytecode.

So if JDave or JavaAssit is the only solution any pointers on the same
would be helpful.


Thanks,
Gurudutta

Johan Haleby

unread,
Dec 13, 2010, 3:10:48 AM12/13/10
to powe...@googlegroups.com
You may be using the wrong combination of PowerMock and EasyMock. PowerMock 1.4.6 requires EasyMock 3.0 (you don't need class extension anymore in this version).

/Johan 


--
You received this message because you are subscribed to the Google Groups "PowerMock" group.
To post to this group, send email to powe...@googlegroups.com.
To unsubscribe from this group, send email to powermock+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/powermock?hl=en.


Reply all
Reply to author
Forward
0 new messages