Author Rob van Maris

IT
1 More JFall highlights: MDA and OCL, Java and scripting, Project Jackpot and the XP Game.

From last week’s JFall conference I picked four of the most interesting sessions I visited to report on:

  • Combining the Power of MDA and OCL: Generating Java Code from OCL (and UML) Models – Jos Warmer
  • Scripting in Java – Martin Wolf
  • Project Jackpot: Refactoring on Steroids – Wilfred Springer
  • XP Game – Martien van Steenbergen
Java
1 JUnit testing with EasyMock

Mockobjects are the classic solution to the even more classic problem of how to test code in isolation, when that code needs other objects to perform its tasks. The problem is we want to test classes individually, without introducing too many other objects that may make our tests too complex.
In this article I hope to wet your appetite for this technique. First I will illustrate the problem with a simple example. Then I will demonstrate a solution, using EasyMock to create mockobjects with minimal coding effort.