Skip to content

Replacing the jMock example with EasyMock - #49

Closed
erosb wants to merge 2 commits into
cxxr:masterfrom
erosb:master
Closed

erosb wants to merge 2 commits into
cxxr:masterfrom
erosb:master

Conversation

@erosb

@erosb erosb commented Dec 1, 2015

Copy link
Copy Markdown

I think EasyMock is a much more widespread mocking library than jMock, so I rewrote the mocking example. Alternatives with links added.

@smoyer64

smoyer64 commented Dec 2, 2015

Copy link
Copy Markdown

From what I've seen, Mockito is the up-and-coming mocking library. It's not clear to me that any of these three systems is likely to become dominant - would it make sense to have parallel examples? "Sensible mocking" should certainly be promoted as part of "Better Java"!

@erosb

erosb commented Dec 2, 2015

Copy link
Copy Markdown
Author

EasyMock and Mockito both seems to be mainstream for me. jMock on the other hand is something I've never heard before. I sent this PR with an EasyMock example because that is my personal preference, but Mockito is fine too.

@cxxr

cxxr commented Dec 2, 2015

Copy link
Copy Markdown
Owner

Interestingly enough I polled a few Java devs I know and Mockito and jMock were the dominant examples and only one had heard of EasyMock. Maybe there's a poll of Java devs asking which libraries they use? Maybe one is clearly better than the others? I don't know, as I've only used Mockito and jMock.

@vincecima

Copy link
Copy Markdown

Here is a survey done by JRebel from last year that touches on mocking tools:

http://zeroturnaround.com/rebellabs/java-tools-and-technologies-landscape-for-2014/16/

@cxxr

cxxr commented Dec 2, 2015

Copy link
Copy Markdown
Owner

From that it seems like Mockito is the clear winner by popularity. jMock and EasyMock aren't mentioned. Is there a way that EasyMock is better than Mockito in some way?

@ramonchiara

Copy link
Copy Markdown

Using Google Trends, I can see that Mockito has been the trend (vastly).

https://www.google.com.br/trends/explore#q=jmock%2C%20easymock%2C%20mockito

2015-12-02 13:30 GMT-02:00 Sean Cassidy notifications@github.com:

Interestingly enough I polled a few Java devs I know and Mockito and jMock
were the dominant examples and only one had heard of EasyMock. Maybe
there's a poll of Java devs asking which libraries they use? Maybe one is
clearly better than the others? I don't know, as I've only used Mockito and
jMock.

—
Reply to this email directly or view it on GitHub
#49 (comment).

@vincecima

Copy link
Copy Markdown

Having personally used Mockito (but not the others), I think treating it as the prevailing but not only tool is appropriate.

@erosb

erosb commented Dec 7, 2015

Copy link
Copy Markdown
Author

Thank you all for the comments, rewriting the example to easymock clearly does not make sense. Thanks for pointing that out, I'm closing this PR

@erosb erosb closed this Dec 7, 2015
@cxxr cxxr mentioned this pull request Dec 7, 2015
@cxxr

cxxr commented Dec 7, 2015

Copy link
Copy Markdown
Owner

I opened an issue to capture that we want to change the jMock example to Mockito.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants