Mock objects with EasyMock

6. Conclusion

So, we have seen all the features of EasyMock to create mock objects for unit tests. Like you’ve seen, it’s a really simple but powerful way to verify the behaviour of an object depending on an other. There are others libraries for mock objects like JMock, JMockit or Mockito, but personally, i think EasyMock is most comfortable to use and give all the features i need to make my own unit tests. That’s why i choose this library to make this article.

I hope this article has interested you. Don’t hesitate to comment it ;)

Related posts:

  1. Develop a modular application – Implementation
  2. Java 7 : The new java.util.Objects class
  3. JR Operations and Capabilities
  4. Swing tip : A better SwingWorker without exception swallowing
  5. Tip : Add resources dynamically to a ClassLoader

Pages: 1 2 3 4 5

  • http://www.monitorlcd17.org Monitor LCD 17

    a very good article with examples.

  • Shan6051

    I am facing a problem while testing a method.
    this method calls A class which calls B class and B calls D interface. I am mocking the Interface but since this is not directly going in the Method (to be tested) ….is it possible to do this type of testing because in all examples i saw only one class and one Interface only …
    Please HELP me !!

  • http://www.aryol.com.tr prefabrik

    another great post. I’m big fan of this site. Thanks for the codes.

  • Pingback: JUnit: Automatically Managing Mocks « Ted Young