Pragmatic Unit Testing with TestNG and EasyMock
You've heard about unit testing but were daunted when it came time to put the pedal to the metal. That's because JUnit is just one tool and there's others you need to learn about, including the wonderful and wierd EasyMock and the easy and powerful TestNG.
Unit testing with JUnit only gets you so far; even when you've refactored your code and hidden all your implementations behinds interfaces you are still stuck with the problem of testing the individual pieces. If you've hit this point and despaired, know that there are tools to help … including the wierd and wonderful EasyMock. We'll discuss unit testing in general, and how EasyMock is used to to generate mock objects, allowing you test each class in isolation. We'll also leave JUnit behind and investigate using TestNG, a modern and improved test framework. We'll then learn how to tame EasyMock's awkward API with some modest refactoring and naming conventions.
About Howard Lewis Ship
Howard Lewis Ship is the original creator of the Apache Tapestry project, and is a noted expert on Java framework design and developer productivity. He has over twenty years of full-time software development under his belt, with over fifteen years of Java. He cut his teeth writing customer support software for Stratus Computer, but eventually traded PL/1 for Objective-C and NeXTSTEP before settling into Java.
Howard has been developing financial and e-commerce applications in 100% Clojure since 2012.
Howard currently works for Wal-Mart's Global E-Commerce division. He lives in Portland, Oregon with his wife Suzanne, and his children, Jacob and Olivia.
More About Howard »