By spiros on May 16, 2007
The current stable version (2.2) of the maven-surefire-plugin does not support JUnit 4. So Maven, out of the box, does not work with JUnit 4. Luckily if we want to use JUnit 4 in our Maven based projects we have two choices. The first is to use JUnit4TestAdapter as illustrated in this post. The second [...]
Posted in Java | Tagged junit, maven |
By spiros on October 23, 2005
Pragmatic Unit Testing is an easy to read introduction to unit testing. This book covers the basic information you need to know in order to effectively write unit tests. This book covers in less than 200 pages: What is unit testing and why developers must unit test every piece of code they write. An introduction [...]
Posted in Java | Tagged book, junit
By spiros on May 26, 2005
Ivan Moore has a great post “Replacing Inheritance with Composition” at his blog, that explains how when you refactor your code from using Template Method to using Strategy can reduce the code duplication in your unit tests and also make your tests simpler. Both patterns, template method and strategy, try to solve the same problem. [...]
Posted in Java | Tagged design patterns, junit, oop
By spiros on May 24, 2005
If you are new to TDD and to mock objects (like me) you may want to read the paper “Mocks Aren’t Stubs” written by Martin Fowler. In this article Fowler talks about the two testing paradigms, state based and interaction based. I will use TDD, for the first time, in my next project and I [...]
Posted in Java | Tagged junit, tdd