CoView Editor: Identify Method Under Test
The CoView Editor is an editor that extends the Java Editor. It provides advanced unit testing capabilities but can also be used for any type of Java development efforts.
To measure path coverage, CoViewDeveloper requires explicit identification of the method(s) under test. If the method under test is not identified in a Javadoc, CoViewDeveloper inserts an annotation
in the left column of the CoView Editor.
To resolve the method under test, click on the
annotation.
If you cannot identify the appropriate method from those listed, select Browse for Method Under Test. This wizard will walk you through selecting the appropriate class and method under test that the test case is attempting to exercise. In the window Identify Method Under Test, select Browse.
Next, in the window Select Type, either select the matching type or type in the class name. Additional filters are available in the pull down menu, available by selecting
. The filters include:
- Fully Qualify Duplicates: Select this option if more than one method shares a name.
- Show Container Info: Select this option to display the full container information.
After selecting or typing in the appropriate class, you are taken back to the Identify Method Under Test window, with the class and method tree displayed. Highlight the method being tested and select OK. Your test case will now look like this:
From here, you can view run the JUnit test through the Eclipse JUnit Runner (in the Package Explorer, select Run As> JUnit Test) or the CoView JUnit Runner (select Run As > CoView JUnit Test). Note that you must run this test case through the CoView JUnit Runner in order to view metric and coverage information.