jUnit is a framework for writing and running test cases—http://junit.org/. A test is a Java class containing jUnit annotations to set up the test and identify test methods. Basically, you annotate test methods with the
@Test annotation and verify results using assertion. When you want to check a value dependent on the nature of the check and the type of the value, you call the appropriate assertion.
For example, if you want to check that the value of a Boolean variable is
true, you would write:
assertTrue(var). There are many different assertions located in package import
org.junit.Assert.*. Notice that you have to import this package statically to each test class. Methods containing test code are annotated with