We have three basic types of tests
- Functional tests you develop during development of the application using TDD
- UI tests that test the user interface
- UAT tests provided by the Customer
In all cases the tests are invoked by selecting the test and running an individual test or selecting AllTests.java which is our convention for running all the tests in a package. In the Project Explorer view, junit, junit.mode are packages. All of the tests produce a perspective that has a tab at the top labeled JUnit. You can move that tab around to an area you prefer. If there are errors you can click on the text in the JUnit view to get to the offending lines. To run all the functional tests for the bank application find and right click AllTests.java. Select “Run As” then “JUnit”
You should see something like this. If you can’t find your JUnit view because you have a different layout you have two options:
- Have Eclipse find it for you. Use the Eclipse menu bar Window menu item. Select Show View and then pick JUnit. The JUnit view shod become the top level window. You can optionally perform 2 below if you want to put the Uniit View in some fixed location.
- To customize your Eclipse workspace layout.
Follow the same pattern to run a UAT test. In this case we would like to run the CreateAccountOwnerUatVerboseTest.java. To run the test Run As – JUnit
The UAT tests produce html output in addition to the JUnit output. If you look in the Console View you will see a line that starts with /var… and ends in .html.
Copy and paste the above line from your Console View into your browser. You should see something like this and the text and results should be familiar to you. The formatting of the page below may change.