| C H A P T E R 7 |
|
Automatically Testing MIDlet Suite Management and Execution |
Java Wireless Client provides two scripts that automatically install, run, and remove one or more MIDlet suites. The autotest script works with a single MIDlet suite, and the autotestm script works with multiple MIDlet suites. This chapter covers both scripts.
The autotest script runs the com.sun.midp.installer.AutoTester MIDlet. The MIDlet installs a MIDlet suite from a given location, runs the suite in a loop for a specified number of iterations or until a new version of the suite is not found, then removes the suite. The autotest script is in the InstallDir/midp/bin directory.
The following summarizes the command line for the autotest script:
autotest [url [securityDomain:permissions] [numberOfIterations]]
The HTTP or HTTPS URL of a JAD or JAR file. The MIDlet suite is installed from this URL. If this argument is not given, a form queries the user for the arguments.
The security domain to use for unsigned MIDlet suites. If provided, this value overrides the default domain for unsigned suites, which is called unidentified.
Integer specifying how many times to run the suite. If this argument is not given or is less then zero, the script executes the suite and then attempts to install the next suite using the same URL. If this attempt is successful, the next suite is executed. Otherwise, the script exits.
On optional parameter, this specifies a list of permissions that must be allowed for securityDomain. The all setting grants permissions to all users.
Use the autotestm script to run the MIDlet com.sun.midp.installer.AutoTesterMulti. The MIDlet fetches a list of URLs that point to the suites to install. In parallel for each specified suite, the MIDlet installs or updates the suite, runs the first MIDlet in the suite in a loop for either the specified number of iterations or until the new version of the suite is not found, then removes the suite.
The autotestm script is in the InstallDir/midp/bin directory. It is only available in MVM mode (that is, if Java Wireless Client was built with USE_MULTIPLE_ISOLATES=true and CLDC HI was built with ENABLE_ISOLATES=true option.
The following summarizes the command line for the autotestm script:
autotestm [url [securityDomain:permissions] [numberOfIterations]]
The HTTP or HTTPS URL of an HTML page with links to MIDlet suites. The HTML page must have lines with this form in the body:
<a href="http://machine[:port]/suiteName.jad">suiteName</a>
<a href="http://localhost/suite1.jad">Suite1</a>
<a href="http://localhost/suite2.jad">Suite2</a>
If url is not given, a form queries the user for the autotest script's arguments.
The security domain to use for unsigned MIDlet suites. If provided, this value overrides the default domain for unsigned suites, which is called unidentified.
Integer specifying how many iterations to run the suite. If this argument is not given or is less then zero, the script executes the suite and then attempts to install the next suite using the same URL. If this attempt is successful, the next suite is executed. Otherwise, the script exits.
Copyright © 2007, Sun Microsystems, Inc. All rights reserved. SUN PROPRIETARY/CONFIDENTIAL.