UNIT TEST IN ECLIPSE
- Choose Run > Run Configurations.... The Run Configurations window will appear.
- Right-click on JUnit and choose New.
- Set Test runner to JUnit 4.
- Set the other variables to values similar to those in the screen shot on the right.
- Click on the Classpath tab.
- Remove the
(default classpath) entry.
- Click on User Entries.
- Add these 2 folders (Advanced... > Add folders):
- Add all JARs from these folders:
business/src/main/lib-runtime/ (actually, lib-runtime is empty)
- Ensure the two folders are at the top. It avoids conflicts.
- Click Run.
- The suite has 4 tests, in the class QueryBuilderTest.
- Watch the results in the JUnit View panel. It will tell you quickly whether the tests succeeded or not.
- Problems? Eclipse might not be ready for junit - see
Could not create task or type of type: junit.
©2017, 2018 Geoff Callender, Sydney, Australia