Learning Topic: Unit Testing using JUNIT4

This week I have begun learning JUNIT4 using Kindle book “Mastering Unit Testing Using Mockito and JUnit” by Sujoy Acharay.

Here is the process I have been following:

  1. Using Eclipse, coded all the examples in chapter 2, ran the tests, and debugged as needed.
  2. Added all test classes to TestSuite class so that all tests can be executed easily.
  3. Added comments so that I can better understand the code and because it is the right thing to do.
  4. Added some other tests for practice and for better understanding.
  5. Renamed some of the classes and methods to be more meaningful.

When done I will have some sample test code which I can use as models for any testing I do in the future.

Work in progress in which I am adding all the tests to TestSuite class and adding comments:

TestSuite Java Class for JUNIT4 Learning

Work in progress in which I am adding comments to classes:

AssertThatTest Java Class for JUNIT4 Learning