EasyMock, makes mocking easier since 2001
Java Shell
Clone or download
henri-tremblay Merge pull request #223 from tobymurray/master
Replace "ou" with "or" in user guide
Latest commit 0a8b44d Aug 1, 2018
Failed to load latest commit information.
bench Upgrade JMH to 1.21 May 6, 2018
core Upgrade ASM and javadoc plugin Jun 4, 2018
test-android Starting to develop version 3.7-SNAPSHOT Apr 9, 2018
test-deploy Starting to develop version 3.7-SNAPSHOT Apr 9, 2018
test-integration Starting to develop version 3.7-SNAPSHOT Apr 9, 2018
test-java8 Starting to develop version 3.7-SNAPSHOT Apr 9, 2018
test-nodeps Starting to develop version 3.7-SNAPSHOT Apr 9, 2018
test-osgi Starting to develop version 3.7-SNAPSHOT Apr 9, 2018
test-testng Starting to develop version 3.7-SNAPSHOT Apr 9, 2018
website Replace "ou" with "or" in user guide Jul 31, 2018
.editorconfig Indent html at 2 Oct 4, 2016
.gitattributes Remove the website from the languages used Jan 5, 2017
.gitignore Cleanup .gitignore Dec 20, 2016
.travis.yml Update travis to 27 Apr 6, 2018
CONTRIBUTING.md Add contribution rules Jul 26, 2014
EasyMock-cleanup.xml Set save, formatting and cleanup on all projects Apr 26, 2012
EasyMock-formatter.xml Drop Java 5 (close #192) Sep 8, 2017
README.md Add release notes Apr 9, 2018
ReleaseNotes.md Fix some typos in the release notes Apr 10, 2018
deploy-easymock.sh Should not hardcode the version Nov 16, 2017
deploy-website.sh New parameter to keep the actual behavior on new git versions Jan 5, 2015
findbugs-exclude.xml Fix findbugs issues Apr 8, 2018
generate-changelog.sh Add a header specifying github v3 api is wanted Nov 16, 2017
header.txt Use LF everywhere Dec 23, 2016
mail.txt Mail to send to the yahoo group Nov 6, 2014
pom.xml Upgrade ASM and javadoc plugin Jun 4, 2018
start-next-version.sh Comments on the parameters needed Oct 20, 2014



Join the chat at https://gitter.im/easymock/easymock

Download latest version

EasyMock is a Java library that provides an easy way to use Mock Objects in unit testing.

You can find the website and user documentation at http://easymock.org.

Developer information

Build status

Build Status Maven Central

Environment setup

I'm using:

  • IntelliJ 2017.3 Ultimate (thanks to JetBrains for the license)
  • Maven 3.5.0

You can also use Eclipse. I tried

  • Eclipse 4.5.0 (Mars)
  • Say yes to all the plugins an m2 connectors to install

To configure your local workspace:

  • Import the Maven parent project to Eclipse or IntelliJ
  • Import the Eclipse formatting file EasyMock-formatter.xml (usable in Eclipse or IntelliJ)

To build EasyMock with Maven

There are three different levels of build.

Build without any active profile

It is a basic compilation of the application.

mvn install

Full build

This build will check code coverage using Jacoco, run findbugs and validate that the license headers are correctly set.

mvn install -PfullBuild

Deploy build

This is the build to launch to deploy to the surefire repository. It assembles the application and add the gpg checksum. You will usually launch it on top of the full build.

The command line will ask you to give the passphrase for the gpg private key.

mvn install -PdeployBuild

To compile EasyMock in Eclipse

  • Install m2e
  • Import the EasyMock Maven parent project to your Eclipse workspace

To compile EasyMock in IntelliJ

  • Import the EasyMock Maven parent project as an New IntelliJ project

To update the versions

  • mvn versions:set -DnewVersion=X.Y -Pall
  • mvn versions:commit -Pall if everything is ok, mvn versions:revert -Pall otherwise

Configure to deploy to the Sonatype maven repository

  • You will first need to add something like this to your settings.xml
  • Then follow the instructions from the site below to create your key to sign the deployed items


To build the maven site (with findbugs, checkstyle, jdepends and JavaNCSS reports)

  • You will to give enough memory to maven with 'set MAVEN_OPTS=-Xmx512m' (or setting it as environment variable)
  • Then type mvn site

To check dependencies and plugins versions

mvn versions:display-dependency-updates versions:display-plugin-updates -Pall

To download the sources associated to our dependencies

mvn dependency:resolve -Dclassifier=sources

To update the license

mvn validate license:format -Pall

To run Sonar

mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent test sonar:sonar


  • Install the Android SDK
  • Configure a device (real or simulated)
  • Add an ANDROID_HOME to target the Android SDK
  • Add $ANDROID_HOME/platform-tools to your path
  • Activate the debug mode if it's a real device
  • mvn install -Pandroid

To bundle EasyMock and deploy

  • Make sure the poms are on the snapshot of the version you want to deploy
  • Launch and Android emulator or connect an Android phone
  • Make sure jq is installed. If not, try brew install jq or choco install jq
  • Add a little speech on the features in "ReleaseNotes.md" (remove the Change Log part, which will be regenerated automatically)
  • Set the github_user, github_password, gpg_passphrase, bintray_user, bintray_api_key as environment variables
  • Launch ./deploy-easymock.sh version
  • During the deployment, you will be asked to do different things. Do them
  • Announce to gitter, tweet and blog ;-)

Deploy the website

  • In local:
    • Go to the EasyMock root directory
    • Make sure the website directory is clean
    • ./deploy-website.sh

Start next version

In local:

mvn versions:set -DnewVersion=X.Z-SNAPSHOT -Pall
mvn versions:commit -Pall