Giter VIP home page Giter VIP logo

easymock's Introduction

EasyMock

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

Travis status

Build Status

Environment setup

I'm using:

  • Eclipse 4.3.2 (Kepler Service Release 2)
  • Maven 3.2.3
  • m2e with the following connectors:
    • buildhelper (for build-helper-maven-plugin)
  • IntelliJ 14 Ultimate (thanks to JetBrains for the license)

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 -Pandroid,bench
  • mvn versions:commit -Pandroid,bench if everything is ok, mvn versions:revert -Pandroid,bench otherwise

Configure to deploy to the Sonatype maven repository

  • You will first need to add something like this to your settings.xml
<servers>
  <server>
    <id>sonatype-nexus-snapshots</id>
    <username>sonatypeuser</username>
    <password>sonatypepassword</password>
  </server>
  <server>
    <id>sonatype-nexus-staging</id>
    <username>sonatypeuser</username>
    <password>sonatypepassword</password>
  </server>
</servers>
  • Then follow the instructions from the site below to create your key to sign the deployed items

http://www.sonatype.com/people/2010/01/how-to-generate-pgp-signatures-with-maven/

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

Android

  • 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

<repositories>
  <repository>
    <id>sonatype-nexus-staging</id>
    <name>Nexus Release Repository</name>
    <url>https://oss.sonatype.org/content/repositories/orgeasymock-213/</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
  </repository>
</repositories>
  • Release the repository. It will be synced with Maven Central Repository
  • Announce to [email protected], 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

easymock's People

Contributors

henri-tremblay avatar agilespirit avatar todderz avatar tammofreese avatar danners avatar

Watchers

James Cloos avatar Eason Yi avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.