SignatureTest

Revision as of 16:11, 5 November 2009 by Admin (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)

Signature tests verify that public and protected members of non-private classes in each module do not change or remain compatible with previous version. These tests are part of the build or the continuous build process. The testing infrastructure is currently based on APITest, an extension and temporary fork of sigtest tool which is used as part of the JCP test compatibility kits to verify that the API exposed by a JSR implementation does not diverge from the reference implementation.

Continuous Check for Changes

The continuous build process runs a sigtest build that compares APIs in a new build with APIs of the one of the previous build. Whenever there is a change (either compatible or incompatible) a mail is sent:

  • if the module has public packages - to the api-changes@netbeans.org mailing list
  • if the module has friends in other clusters - to the api-changes@netbeans.org mailing list
  • if the module has friends only in the same cluster - to appropriate cvs@<module>.netbeans.org mailing list
  • if the module has neither friends, neither public packages - it is skipped from the check

Appropriate owners of each module and tech leads of each area are expected to review the change and prevent or revert unintentional changes.

The signature golden files are generated by

ant -f nbbuild/build.xml gen-sigtests 

and compared by

ant -f nbbuild/build.xml gen-sigtests 

Check for Incompatible Changes Since Previous Version

There is another check for API signature compliance: A check that the APIs are compatible with a previous released version. This check is available to every module, which can make it part of its build by generating its API snapshot by:

ant netbeans gen-sigtest

This creates a file nbproject/org-netbeans-module-name.sig which can be checked into the version control system as a reference point. This check is part of continuous build as well: every module with its golden file in nbproject/org-netbeans-module-name.sig is checked for backward compatibility and failures are included in continuous build test results. To run the same test for one module on local computer just use:

ant netbeans check-sigtest

in your module directory and API of your module will be verified. Of course, only if the signature file exists.

Who needs the Golden Signature File

Not every module with an API needs this golden file; currently only those modules that produced a stable API in release 6.1 have it. The plan is to update these golden files with a new version as soon as it is released, so future checks are done against latest released version.

If an incompatible change is made (discouraged and subject to API review process) the golden file needs to be edited by hand to remove the element that is no longer present in the API.

apitest tool

This check for incompatibilities is done by NetBeans' own version of an OpenJDK tools. This adds a standard Ant task to check for binary backward compatibility, mutual signature compatibility. The binary compatibility check ignores generic types. Its sources are distributed together with its Mercurial repository and are available under GPL version 2. Builds are available from our hudson builder.

Other NetBeans Tests

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo