|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.tdk.signaturetest.Result
com.sun.tdk.signaturetest.SigTest
com.sun.tdk.signaturetest.SignatureTest
public class SignatureTest
SignatureTest is the main class of signature test.
The main purpose of signature test is to ensure that programs written in Java using the class libraries of one Java implementation of a specific API version (ie. 1.1, 1.2, etc.) can rely on having the same and only the same Java APIs available in other implementations of the same API version. This is a more stringent requirement than simple binary compatibility as defined in the Java Language Specification, chapter 13. It is in essence a two-way binary compatibility requirement. Therefore, third party implementations of the Java API library must retain binary compatibility with the JavaSoft API. Also, the JavaSoft API implementation must retain binary compatibility with the Java API library under test.
SignatureTest implements the standard JavaTest 3.0
com.sun.javatest.Test
interface and uses the standard
main()
method implementation. SignatureTest allows to
check only specified by command line the package or packages. SignatureTest tracks the following aspects of binary compatibility:
SignatureTest tracks all of the public and protected class members for each public class and interface.
For each constructor or method tracked, SignatureTest tracks all modifiers except native and synchronized. It also tracks other attributes for constructors and methods: method name, argument types and order, return type, and the declared throwables.
For each field tracked, SignatureTest tracks all modifiers except transient. It also tracks these other attributes for fields: data type, and field name.
Usage:
java com.sun.tdk.signaturetest.SignatureTest
<options>where <options> includes:
-TestURL
<URL> -FileName
<n> -Package
<package> -PackageWithoutSubpackages
<package> -Exclude
<package_or_class_name> -Package
or by
-PackageWithoutSubpackages
options. If the specified parameter
names a package, all its subpackages are implied to be also excluded. Such
option should be included for each package (but subpackages) or class, which
is not required to be traced.
-FormatPlain
-AllPublic
-Classpath
<path> java.io.File.pathSeparator
to separate directory and/or zip-file
names in the specified path. Only classes from <path> will be used for
tracking adding classes.
-static
-Version
<version> getProperty("java.version")
.
-CheckValue
- Check values of primitive constant. This option can be used in static mode only.
-Verbose
- Enable error diagnostic for inherited class members.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.sun.tdk.signaturetest.plugin.PluginAPI |
---|
PluginAPI.InjectionPoint |
Field Summary | |
---|---|
static java.lang.String |
BINARY_MODE
|
static java.lang.String |
CHECKVALUE_OPTION
|
static java.lang.String |
ENABLESUPERSET_OPTION
|
protected Exclude |
exclude
|
static java.lang.String |
FILES_OPTION
|
static java.lang.String |
MODE_OPTION
|
static java.lang.String |
NOCHECKVALUE_OPTION
|
static java.lang.String |
NOMERGE_OPTION
|
protected PackageGroup |
secure
|
static java.lang.String |
SECURE_PACKAGES_OPTION
|
static java.lang.String |
UPDATE_FILE_OPTION
|
static java.lang.String |
WRITE_OPTION
|
Fields inherited from class com.sun.tdk.signaturetest.Result |
---|
NO_EXIT |
Fields inherited from interface com.sun.tdk.signaturetest.plugin.PluginAPI |
---|
AFTER_BUILD_MEMBERS, AFTER_CLASS_CORRECTOR, BEFORE_MESSAGE_SORT, BEFORE_TEST, BEFORE_WRITE, CLASS_CORRECTOR, IS_CLASS_ACCESSIBLE, ON_CLASS_LOAD |
Constructor Summary | |
---|---|
SignatureTest()
|
Method Summary | |
---|---|
protected boolean |
allowMissingSuperclasses()
|
void |
decodeOptions(java.lang.String optionName,
java.lang.String[] args)
|
protected java.lang.String |
getComponentName()
|
protected static SignatureTest |
getInstance()
|
protected boolean |
isAPICheckMode()
|
static void |
main(java.lang.String[] args)
Run the test using command-line; return status via numeric exit code. |
protected boolean |
normalizeReq()
|
protected boolean |
prepareCheck(MultipleFileReader in,
java.io.PrintWriter log)
|
void |
run(java.lang.String[] args,
java.io.PrintWriter log,
java.io.PrintWriter ref)
This is the gate to run the test with the JavaTest application. |
protected void |
setupLoaders(ClassDescriptionLoader loader,
ClassDescriptionLoader second)
|
protected void |
usage()
Prints help text. |
boolean |
useErasurator()
|
protected boolean |
verifyClass(ClassDescription required,
boolean supportNSC)
Check if the required class described in signature file also presents
(and is public or protected) in the API being tested. |
protected void |
verifyClass(ClassDescription required,
ClassDescription found)
Compare descriptions of the required and
found classes. |
Methods inherited from class com.sun.tdk.signaturetest.SigTest |
---|
addFormat, addInherited, decodeCommonOptions, getClassDescrLoader, getContext, getErrorManager, getFileManager, getFilter, getLog, getNumErrors, getNumWarnings, getTransformer, initErrors, isConstantValuesTracked, isPackageMember, load, loadPlugin, normalizeArrayParaemeters, printErrors, removeUndocumentedAnnotations, setClassDescrLoader, setConstantValuesTracked, setErrorManager, setFilter, setFormat, setLog, setMessageTransformer, setTransformer, setupProblem, storeError, storeWarning, unpackContainerAnnotations |
Methods inherited from class com.sun.tdk.signaturetest.Result |
---|
error, exit, failed, getReason, isPassed, notrun, passed, passed, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CHECKVALUE_OPTION
public static final java.lang.String NOCHECKVALUE_OPTION
public static final java.lang.String MODE_OPTION
public static final java.lang.String ENABLESUPERSET_OPTION
public static final java.lang.String FILES_OPTION
public static final java.lang.String NOMERGE_OPTION
public static final java.lang.String WRITE_OPTION
public static final java.lang.String UPDATE_FILE_OPTION
public static final java.lang.String SECURE_PACKAGES_OPTION
public static final java.lang.String BINARY_MODE
protected Exclude exclude
protected PackageGroup secure
Constructor Detail |
---|
public SignatureTest()
Method Detail |
---|
public static void main(java.lang.String[] args)
run(String[],PrintWriter,PrintWriter)
protected static SignatureTest getInstance()
public void run(java.lang.String[] args, java.io.PrintWriter log, java.io.PrintWriter ref)
log
- This log-file is used for error messages.ref
- This reference-file is ignored here.main(String[])
public void decodeOptions(java.lang.String optionName, java.lang.String[] args) throws CommandLineParserException
CommandLineParserException
protected void usage()
usage
in class SigTest
protected java.lang.String getComponentName()
getComponentName
in class SigTest
public boolean useErasurator()
useErasurator
in class SigTest
protected boolean allowMissingSuperclasses()
protected boolean normalizeReq()
protected boolean isAPICheckMode()
protected void setupLoaders(ClassDescriptionLoader loader, ClassDescriptionLoader second)
protected boolean verifyClass(ClassDescription required, boolean supportNSC)
required
class described in signature file also presents
(and is public or protected) in the API being tested. If this method
fails to findByName that class in the API being tested, it appends
corresponding message to the errors
log
.
Status.failed("...")
if security exception occurred;
or Status.passed("")
otherwise.SigTest.log
protected void verifyClass(ClassDescription required, ClassDescription found)
required
and
found
classes. It is assumed, that description for the
required
class is read from signature file, and the
found
description belongs to that API being tested. If the
descriptions compared are not equal to each other (class names differ, or
there are different sets of public members in them), this method appends
corresponding error messages to the
log
-file. Note, that equality of class or member names may
do not imply that they have the same
static
and
protected
attributes, and
throws
clause, if the chosen
converter
enables weaker equivalence.
SigTest.log
protected boolean prepareCheck(MultipleFileReader in, java.io.PrintWriter log)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |