C H A P T E R  23

Relevance Filtering

If a harness’s Preferences specifies that relevance filtering is enabled, when the tester closes the configuration editor, the harness calls an optional test pack method for each test case. This method inspects the configuration and returns null if the test is relevant or a list of reasons describing why the test is irrelevant. If you do not implement the method, all tests in your test pack are relevant.

An irrelevant test is one that is pointless to run for either of two reasons:

The test pack developer writes the relevance criteria code for each test, or accepts the default implementation, which checks configuration permissions. As with other configuration filters, such as keywords and status, the harness does not run a test that fails to “pass” its relevance filter, potentially reducing the time required to execute a test run.

To implement relevance filtering, you extend the abstract class TestDependencyProvider. Consult the test-api Javadoc tool documentation for details. For examples, see any Sun test pack, such as installDir/admin/shared/testpacks/Location_(JSR_179)_TestSuite/src/dependencyprovider/com/sun/jdts/lapi/dependencyprovider/LapiDependencyProvider.java. The key TestDependencyProvider method is: isRelevant(TestId): . The harness calls this method for each test case.

There are example relevance filter implementations in devKitInstallDir/tests/runtime/src/client/com/sun/samples/automated/DependencyDemo/.