A pattern for using EasyMock…

May 3rd, 2008

Ralf Stuckert wrote a great article on EasyMock titled "Getting started with EasyMock2."  He clearly defined a pattern for using this library.

The pattern is

    1. Create a mock.

    2. Set up your expectations.

    3. Set the mock to replay mode.

    4. Call your code under test.

    5. Verify that your expectations have been met.

Believe me, knowing this pattern will save you a lot of time trying to figure out how to really use EasyMock when writing tests.

patterns | Comments | Trackback

Leave a Reply

  1.  
  2.  
  3.  
  4. XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
  5. Spam Protection by WP-SpamFree

You can keep track of new comments to this post with the comments feed.

 

May 2008
M T W T F S S
« Apr   Jun »
 1234
567891011
12131415161718
19202122232425
262728293031  

Categories

Archives

Tags