JUnitX Example - Step 2

The unit test for class Inverter is realized by a class extending junitx.framework.PrivateTestCase. It's constructor looks always the same and sets the test name. The test methods are public and prefixed by test. Most tests can be accomplished by using the various assert methods inherited from PrivateTestCase:

JUnitX allows to create instances of any class the VM can access using the newInstance method. Furthermore you can invoke any method of that class independently of its access modifiers using the invokeWithKey method.

Continue with step 3 . . .

© 2001 A. Heilwagen