<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://wiki.apidesign.org/skins/common/feed.css?116"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>SignatureTest - Revision history</title>
		<link>http://wiki.apidesign.org/index.php?title=SignatureTest&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.12.0rc1</generator>
		<lastBuildDate>Sun, 05 Apr 2026 20:29:21 GMT</lastBuildDate>
		<item>
			<title>JaroslavTulach: New page: Copy of netbeans:SignatureTest created for archiving purposes.  __NOTOC__ Signature tests verify that public and protected members of non-private classes in each module do not change o...</title>
			<link>http://wiki.apidesign.org/index.php?title=SignatureTest&amp;diff=10061&amp;oldid=prev</link>
			<description>&lt;p&gt;New page: Copy of &lt;a href=&quot;http://wiki.netbeans.org/SignatureTest&quot; class=&quot;extiw&quot; title=&quot;netbeans:SignatureTest&quot;&gt;netbeans:SignatureTest&lt;/a&gt; created for archiving purposes.  __NOTOC__ Signature tests verify that public and protected members of non-private classes in each module do not change o...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Copy of [[netbeans:SignatureTest]] created for archiving purposes.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
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 [http://deadlock.netbeans.org/hudson/ continuous build process]. The testing infrastructure is currently based on [[APITest | APITest]], an extension and temporary fork of [http://sigtest.java.net/ sigtest tool] which is used as part of the [http://www.jcp.org/ JCP] test compatibility kits to verify that the API exposed by a JSR implementation does not diverge from the reference implementation.&lt;br /&gt;
&lt;br /&gt;
== Use from Maven ==&lt;br /&gt;
&lt;br /&gt;
See [[SigTest]] for the details.&lt;br /&gt;
&lt;br /&gt;
== Consistency Check ==&lt;br /&gt;
&lt;br /&gt;
'''Turned on Nov 7, 2012''':&lt;br /&gt;
&lt;br /&gt;
For a while the [[VersioningPolicy]] prescribes how to properly version modules and their [[API]] changes. However the policy has for a long time only been applied to modules with stable [[API]]. From time to time this leads to ''no such method or class'' errors like {{iz|186233}} which need to be evaluated by ''platform/module system'' component owner. &lt;br /&gt;
&lt;br /&gt;
Moreover the introduction of incremental binary build [[AutoUpdateTask]] requires more proper attitude to versioning. Only then one can be sure that incremental binary build really links properly.&lt;br /&gt;
&lt;br /&gt;
For the above reasons ita consistency check that verifies minimal versioning consistency has been introduced. The [[HgParallelProjectIntegration]] runs:&lt;br /&gt;
&lt;br /&gt;
* Check on all modules exposing non-private packages &lt;br /&gt;
* Compares the spec version.&lt;br /&gt;
:* If the new spec is the same as previous, the check fails if there is some [[API]] change (method or class)&lt;br /&gt;
:* If the new spec is higher, the check will pass regardless of any [[API]] changes.&lt;br /&gt;
&lt;br /&gt;
The check is integral part of push-* jobs and if it detects a failure, the push job fails. '''To recover''' you are supposed to increment spec version of your module whenever you change its API. Increment spec versions of modules that depend on your [[API]] change as well (not enforced right now). Run following command to simulate the check locally:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# first of all make sure your system is built OK&lt;br /&gt;
# Then either:&lt;br /&gt;
# generate appropriate JUnit testing report for all modules:&lt;br /&gt;
$ ant check-sigtests-version &lt;br /&gt;
#&lt;br /&gt;
# or run the 'version' check for a single module&lt;br /&gt;
$ ant -f your.module/build.xml check-sigtest -Dsigtest.check.type=versioncheck&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
In case there is a strong need to disable this kind of version checking for an individual module (provided that the owners know how to version properly), one can add following into own ''nbproject/project.properties'' file: ''sigtest.check.type=check''. This is usefull mostly for modules with split packages.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Continuous Check for Changes==&lt;br /&gt;
&lt;br /&gt;
The [http://deadlock.netbeans.org/hudson/ 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:&lt;br /&gt;
* if the module has public packages - to the [mailto:api-changes@netbeans.org api-changes@netbeans.org] mailing list&lt;br /&gt;
* if the module has friends in other clusters - to the [mailto:api-changes@netbeans.org api-changes@netbeans.org] mailing list&lt;br /&gt;
* if the module has friends only in the same cluster - to appropriate '''cvs@&amp;lt;module&amp;gt;.netbeans.org''' mailing list&lt;br /&gt;
* if the module has neither friends, neither public packages - it is skipped from the check&lt;br /&gt;
Appropriate owners of each module and tech leads of each area are expected to review the change and prevent or revert unintentional changes. &lt;br /&gt;
&lt;br /&gt;
The [http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastSuccessfulBuild/artifact/nbbuild/build/sigtest/snapshot/ signature golden files] are generated by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;$ ant -f nbbuild/build.xml gen-sigtests&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and compared by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;$ ant -f nbbuild/build.xml gen-sigtests&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A module can configure sigtest behavior by modifying its '''project.properties''':&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# redefine the email where reports are sent&lt;br /&gt;
sigtest.mail=your.name@your.org&lt;br /&gt;
# don't fail if the generation of the report fails&lt;br /&gt;
sigtest.gen.fail.on.error=false&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== At the time of release ==&lt;br /&gt;
&lt;br /&gt;
When doing a release it is important to record the actual signatures of ''stable'' modules (and to some extend also ''under development'' ones), so we know what to keep [[apidesign::BackwardCompatibility|backward compatibility]] with. To generate these signatures we used to do following, but since [https://github.com/apache/incubator-netbeans/pull/1064 Apache NetBeans is in Git], it is better to follow the [https://github.com/apache/incubator-netbeans/pull/1064 PR-1064 steps]. Anyway here is the old recipe:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ hg update -C releaseXY_fcs&lt;br /&gt;
$ ant clean&lt;br /&gt;
$ ant build&lt;br /&gt;
$ ant gen-sigtests-release&lt;br /&gt;
$ hg st|cut -c 3-| xargs zip /tmp/sig.zip&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last target will modify a lot of module/nbproject/*.sig files and possibly generate some new. These files shall be integrated into trunk build. For example by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd &amp;lt;team-repository&amp;gt;&lt;br /&gt;
$ hg update -c default&lt;br /&gt;
$ unzip /tmp/sig.zip&lt;br /&gt;
$ hg add .&lt;br /&gt;
$ hg ci -m &amp;quot;Signatures as of release X.Y&amp;quot;&lt;br /&gt;
$ hg push&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Check for Incompatible Changes Since Previous Version==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ant netbeans gen-sigtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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 [http://deadlock.netbeans.org/hudson/job/trunk/lastBuild/testReport/ test results]. To run the same test for one module on local computer just use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ ant netbeans check-sigtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in your module directory and API of your module will be verified. Of course, only if the signature file exists.&lt;br /&gt;
&lt;br /&gt;
===Who needs the Golden Signature File===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
If an incompatible change is made (discouraged and subject to [http://openide.netbeans.org/tutorial/reviews API review process]) the golden file needs to be edited by hand to remove the element that is no longer present in the API. &lt;br /&gt;
&lt;br /&gt;
== Checking for all changes from previous release ==&lt;br /&gt;
&lt;br /&gt;
In case you have the sig file in nbproject directory generated at the time of previour release (all public APIs have it), you can see all changes since that time by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ ant -f yourmodule/build.xml check-sigtest -Dsigtest.check.type=strictcheck&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===apitest tool===&lt;br /&gt;
&lt;br /&gt;
This check for incompatibilities is done by [[APITest| 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 [http://hg.netbeans.org/apitest/ sources] are distributed together with its Mercurial repository and are available under GPL version 2. Builds are available from our [http://deadlock.netbeans.org/hudson/job/apitest/ hudson builder].&lt;br /&gt;
&lt;br /&gt;
===Other NetBeans Tests===&lt;br /&gt;
&lt;br /&gt;
* [[FindBugsTest | FindBugsTest]]&lt;/div&gt;</description>
			<pubDate>Wed, 04 Dec 2019 06:58:29 GMT</pubDate>			<dc:creator>JaroslavTulach</dc:creator>			<comments>http://wiki.apidesign.org/wiki/Talk:SignatureTest</comments>		</item>
	</channel>
</rss>