The Artima Developer Community
Sponsored Link

Java Community News
Getting Started with EasyMock2

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Getting Started with EasyMock2 Posted: Jun 22, 2006 10:11 AM
Reply to this message Reply
Summary
EasyMock is a dynamic mock object generator: It helps write unit tests by generating mock objects on the fly using Java's proxy mechanism. A recent java.net article introduces EasyMock2, and provides a tutorial on testing with mock objects.
Advertisement

While writing unit tests for simple classes and interfaces is trivial, in most real-world systems classes and interfaces do not exist in isolation, but instead rely on other system components to operate. Testing such interrelated components is much more difficult and error-prone.

Mock objects provide a technique to test components of a complex system in isolation. EasyMock was the first tool to implement the concept and help generate mock objects, and is still the most popular. In a recent java.net article, Getting Started with EasyMock2, Ralf Stuckert introduces testing with mock objects, and highlights new features in EasyMock2, such as:

  • No more need for a dedicated control object.
  • Heavy usage of generics eliminates casts.
  • New matcher API allows fuzzy parameter matching.
  • Check call order of more than one mock.
  • Dynamically respond to mock method calls.

What's your experience with EasyMock and mock objects-based testing?

Topic: Getting Started with EasyMock2 Previous Topic   Next Topic Topic: SIP Programming for the Java Developer

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use