File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Testing and the fly likes Mock without interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Mock without interface" Watch "Mock without interface" New topic

Mock without interface

avihai marchiano
Ranch Hand

Joined: Jan 10, 2007
Posts: 342
is there a mock framework atht not require to have inetrface of the mock object?

thank you
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

Easymock has a Class Extension that allows you to mock classes. There are some restrictions so check that page.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
David Newton

Joined: Sep 29, 2008
Posts: 12617

Mockito can mock classes, although not final ones. It's my current mocking of choice.
I agree. Here's the link:
subject: Mock without interface
It's not a secret anymore!