Unit testing software always requires a testing framework. Based
on his Smalltalk experiences, Kent Beck developed JUnit
together with Erich Gamma. Nowadays it is one of the standard
frameworks with a lot of extension modules.
JUnitX is one of those modules, allowing to test private and
protected Java classes, methods and variables.
JUnit and JUnitX are supported in Together,
the leading UML-modelling tool by the module XPTest.
XPTest also provides test class generation and test maintainance features.
To get started with Unit testing, read the article
Test Infected of Kent Beck or look
through the example below. If you want to get the real stuff, read the
new tutorial on Advanced
Java Testing.
For the rest of you, here is an introductionary example showing you
how to use JUnit and JUnitX and what are the main differences: