C H A P T E R  13

Updating a Test Pack

This chapter describes how to update a test pack. Test packs are usually updated as part of a test pack development cyclical workflow. The most common reasons to update a test pack are as follows:

This appendix is divided into the following sections:


Test Pack Identifiers

When you update a test pack, observe the following rules for changing test pack identifiers in the testsuite.info file.


Test Pack Version Identifier

When you begin to revise a test pack, prefix the version number with the characters ++ as described in Optional Properties (version number is specified in testsuite.info) or Test Pack Versioning Alternative (version number is in testpack.version.properties).

When you are ready to deploy the test pack, remove the ++ characters and increment the version number as described in Optional Properties (version number is specified in testsuite.info) or Test Pack Versioning Alternative (version number is in testpack.version.properties)


Test Rename File

If you rename one or more tests in a test pack, you must include a test rename file in the revised test pack. The rename files are .properties files. For a complete syntax description of the file, see http://java.sun.com/j2se/1.5.0/docs/api/java/util/
Properties.html#load(java.io.InputStream)
.

A rename file maps old test names to new test names. The harness uses the rename file to contend with old test names (created when the name was current) that are found in Java Device Test Suite version 2.0 templates or in Java Device Test Suite version 1.4 profiles.

Each revision of a test pack that includes renamed tests must have its own rename file. Create rename files in the packWorkDir/testpackName/renames/ directory. A rename file name has the following syntax:

jdts_testnames_oldVersion_newVersion.list

An example of a rename file name can be jdts_testnames_1.1_1.2.list. The identifier packVersion1.1 is the oldVersion and the identifier packVersion1.2 is the newVersion. The version identifiers are from the TestSuiteVersion property.

A rename file is a text file containing one line per renamed test. Each line has the following syntax:

fullyQualifiedOldName=fullyQualifiedNewName

An example of a renamed test line is com.myco.mypk.funct.read.read1=com.myco.mypk.funct.readFile.read1. In this example the fullyQualifiedOldName is com.myco.mypk.funct.read.read1 and the fullyQualifiedNewName is com.myco.mypk.funct.readFile.read1.


Test Pack Property Rename File

You can rename test pack properties (those defined in testsuite.info), but you cannot rename test class or test case properties. When you rename a test pack property, you introduce a new name for the property and associate it with the test pack version you are creating. The property is not renamed in templates that were created with earlier versions of the test pack.

The harness uses a rename file that you supply to map the alternative names and versions. For example, consider the following scenario of two test pack updates:

Properties in templates include the name and version of the test pack for which they were created. When an administrator installs version 3 of the test pack, the harness finds templates that name the test pack and version 1 and changes the default value of Alpha 1 to 2. It finds templates that name the test pack and version 2 and changes the default value of Beta from 1 to 2. Templates created after the installation of version 3 use the property name Beta and the default value 2. In addition, a version 2 or version 3 test that retrieves the value of Beta when running with a template that defines Alpha, receives the value of Alpha.

To rename a test pack property, follow these steps:

1. If it does not exist, create a text file named packWorkDir/renames/propertiesrenamings.properties.

2. Add one line to the file for each renamed property, using this format:

{TestPackVersion}OldPropertyName=NewPropertyName

TestPackVersion is the value of TestSuiteVersion that you give the test pack when you deploy it as described in Test Pack Version Identifier. It is the version number in which the new name is first effective.

For example, suppose the currently deployed version of the test pack is 1.8 and you are creating version 1.8.1 . The following example renames a property beginning with test pack version 1.8.1:

{1.8.1}ImageCropWidth=ImageCropWidthNew

In the version 1.8.1 testsuite.info, be sure that ImageCropWidth does not exist and that ImageCropWidthNew does exist.