The JUnit team has the following design goals for the framework (From A Cook's Tour):
- Aid in the creation of useful test
- The tests must retain their value over time
- Test reuse should reduce the cost of writing tests
Setting up JUnit is easy. Download the distribution and add the JUnit jar to your classpath.
Classes no longer need to extend TestCase (as in JUnit 3) in JUnit 4. Test methods are indicated with the @Test annotation. Before and After methods are annotated with the @Before and @After annotations respectively.