CoView Test Case Wizard: Creating a New CoView JUnit Test Case
The CoView Test Case Wizard walks you through the creation of a JUnit test case or test suite for a class. The wizard creates fully functional JUnit tests (using fail assertions) for methods you choose. These tests are meant to exercise at least one data-flow path and can be duplicated and modified to other paths.
The first page of the New CoView Test Case Wizard allows you to specify information about the test case being created. To create a test case, the following information must be specified:
- JUnit Version: Identifies the JUnit version used to create tests
- Source Folder: Identifes the source folder within the project that will contain the test case
- Package: Identifies the Java package to which the test case belongs
- Name: Identifies the name of the test case class to be created
- SuperClass: Identifies the class which the new test case will extend
- Class Under Test: Identifies the class that is to be tested by the new test case
Select Next on the wizard to proceed. The second page of the New CoView Test Case Wizard allows you to specify which methods are to be tested.
Add method invocations using. The toggle indicates that the generated test methods should contain invocations of the methods under test. If this toggle is enabled, an instance of the class under test is needed to invoke the non-static methods under test. Use the drop-down list to select a constructor which will be used to instantiate the class under test.
Select Finish to continue. At this point the test case is created and the CoView JUnit Runner is automatically started. Coverage can be reviewed by looking at the CoView Quality Manager, and the tested path(s) can be identified in the CoView JUnit Developer view. The generated test case can be found in the CoView Editor