C H A P T E R 3 |
Introducing the Developer’s Kit |
Although writing tests is your responsibility, the Java Device Test Suite Developer’s Kit contains components you can modify, or, in some cases, use as is. This chapter introduces many of those components by examining, slightly modifying, and building the sample runtime test pack included in the Developer’s Kit.
To follow this section, begin with a fresh copy of the unzipped Developer’s Kit (see Unzip and Configure the Developer’s Kit). Do not run devKitHome/tests/demo.xml in this copy of the Developer’s Kit.
This chapter has these sections:
This section introduces the directories and files in the Developer’s Kit, focusing on those that implement the sample runtime test pack. The sample benchmark test pack has a very similar structure. The distributed and OTA samples have additional structures to support the more complicated execution models of their tests.
TABLE 3-1 shows the contents of the Developer’s Kit top level directory.
devKitHome |
|
tests/ |
|
docs/ |
|
tpim.sh and tpim.cmd |
Scripts for faster test pack installation, see Chapter 19 |
Developer’s Kit version identifier. Do not change this file. |
This directory contains three sample test packs, a set of common resources used by all test packs, and the demo.xml file you used to build and install the sample test packs in Chapter 2. Do not delete this directory.
devKitHome/tests/ |
|
Do not delete this directory or its contents. It holds common resources required to build any kind of test pack.
This directory contains the sample runtime test pack. If you are writing a benchmark or OTA test pack, you can delete this directory.
Files that control the build for this test pack. Every test pack must have these files. You can edit these files to override default values specified in build/. build.xml is the main Ant build file. |
|
Source and related files that implement the tests in this test pack. Every test pack must have a directory like this. |
|
Source and related files for test components that run on test devices |
|
Source and related files for the server side of network tests |
|
Additional server sources (directory is named in testsuite.info TestServerSourcesDir property) |
|
Top level documentation for this test pack. Every test pack must have a file like this. See Documenting a Test Pack for more information. |
|
Global test suite properties. Every test pack must have a file like this. See Chapter 6 for details. |
|
Test pack version identifier. See Chapter 20 for details. |
Exactly how you create a test pack is subject to variations, such as whether you assemble the files from scratch or begin with a sample. This section introduces one way to begin with the runtime sample test pack.
1. Change to devKitHome/tests/common/build/.
1. Either edit environment.properties as you did in Unzip and Configure the Developer’s Kit or replace environment.properties with the corresponding file from the other Developer’s Kit.
2. Optionally, delete devKitHome/tests/distributed/, benchmark/, and ota/.
You do not need these files in a runtime test pack.
3. Change to devKitHome/tests/runtime/.
4. In testsuite.info change the following lines:
a. Change the value of TestPackName to My Runtime.
b. Change the value of TestSuiteName to My Runtime TestSuite.
c. Change the value of TestSuiteID to com.sun.jdts.devkit.my.runtime.
5. In testpack.version.properties change 1.4 to ++1.0.
7. In build.properties, append these lines:
doc.copyright=\ \ Copyright 2007 My Company. All rights reserved. \n\ \ Use is subject to license terms.
8. Run one of these commands, depending on your platform:
> ant clean all install % ant clean all install
The command displays several hundred messages, ending with BUILD SUCCESSFUL and the elapsed time.
9. Launch or restart your administrator harness.
The new test pack My_Runtime appears in the test tree. It is ready for testing.
TABLE 3-5 summarizes the files that the build generates.
When you have tested your tests, you must package them in a zip file so an administrator can install them in the production Central Installation with the Configure > Test Packs command. In the test pack’s build/ directory, use one of the following commands, depending on your platform:
> ant pack % ant pack