Jtest logo




Contents  Previous  Next  Index

Testing a Set of Classes


In Jtest's Project Testing UI, you can automatically test all (or some) of the classes contained in any directory, jar file, or zip file with a single click. Jtest automatically searches the specified directory, jar file, or zip file, and tests all of the classes that it finds.

It is possible to perform all testing-related activities in the Project UI. The Project Testing UI contains all results for all classes tested, and allows you to access the same features that are available in the Class Testing UI. If you want to test an entire project, then focus on results on a class-by-class basis, you can test the project in the Project Testing UI, then open the class(es) that you want to focus on in the Class Testing UI.

By default, the Project Testing UI performs dynamic analysis only on public classes; this setting can be changed in the Search Parameters> Dynamic Analysis branch of the Project Test Parameters tree.

Also by default, Jtest will not test a class that it has previously tested unless that class has been modified since the previous test. Jtest determines whether or not a class has changed by checking that both the .class file and the .java file contents have not changed. Timestamps are not considered. To force Jtest to test all classes on every test, disable the Skip Classes Already Tested node in the Search Parameters branch of the Project Test Parameters tree.

To test a set of classes:

  1. Open the Project Testing UI by clicking the Project button in the Class Testing UI tool bar, or by choosing Window> Project Testing UI in the Class Testing UI menu bar.
  2. In the Search In field of the Project Testing UI, specify what directory, zip file, .jar file, or set of files you want Jtest to test.
    • To browse for a directory, jar file, or zip file that you want Jtest to start searching and testing, click the Browse button. To select several files at once, CTRL-click or SHIFT-click to select the files that you want to test.
      If the parameter is a directory, Jtest will recursively traverse the path's subdirectories, zip files, and jar files, searching for and testing any classes it finds.
      If the parameter is a jar or zip file, Jtest will open the file and search it for classes in which to find errors.
  3. (Optional) If you want to restrict the classes that Jtest tests, do one of the following:
    • Use the Filter-in field to tell Jtest to find and test only classes that match the given expression. Use regular expressions to indicate what types of files to include.
      For example, if you want Jtest to look only for classes in the util package, enter the following parameter in this field
      util.*
      When this field is left empty, all classes found will be tested.
      For more information about entering regular expressions in this field, see Controls Panel.
    • Use the Skip List to indicate specific classes that you want Jtest to skip. The Skip List is accessible by clicking the Skip List node in the Search Parameters branch of the Project Test Parameters panel. Clicking this node opens a dialog box that lets you enter the names of specific classes in your project that you do not want tested.
    • Use the Test Only List to indicate specific classes that you want Jtest to test. The Test Only List is accessible by clicking the Test Only List node in the Search Parameters branch of the Project Test Parameters panel. Clicking this node opens a dialog box that lets you enter the names of specific classes in your project that you want tested.
  4. Start the test by clicking the Start tool bar button.
    • If you only want to perform static analysis or a specific type of static analysis, right-click the Start button and choose the menu item that describes the type of test that you want to perform.
    • If you only want to perform dynamic analysis or a specific type of dynamic analysis, right-click the Start button and choose the menu item that describes the type of test that you want to perform.

Unless you tell it to do otherwise, Jtest automatically performs all steps required for:

  • Static analysis
  • White-box testing
  • Black-box testing (if Design by Contract-format contract information is included in the classes under test or test case outcomes have been validated)
  • Regression testing (on all test runs after the first)

If you want to configure Jtest to perform only static analysis or only dynamic analysis, modify your testing parameters as described in Customizing Test Parameters.

To have Jtest stop finding and testing classes, click the Stop button.

To have Jtest temporarily pause (or resume) finding and testing classes, click the Pause button. If you pause testing, Jtest will finish testing the current class before pausing.

Results

Results are displayed in the Project Testing UI's Results panel. To learn more about this panel's branches and available options, see Understanding the Results Panel and Exploring and Customizing Project Test Results.


Contents  Previous  Next  Index

ParaSoft logo
(888) 305-0041 info@parasoft.com Copyright © 1996-2001 ParaSoft