Generating Declarations: Designing a Suite to Use Generated Declarations


This case illustrates one problem that declarations can handle: making quick updates to accommodate changes to a component type. However, this isn't the only case where declarations are useful. For example, in the case of buttons--where JavaStar references the button using the actual label--you would have a problem if you renamed the button. Your tests would fail and you'd be left with the task of updating all scripts to use the new button label.

Here's how generated declarations provide a solution:

  1. At one time, you generate a declarations file for each window of your application. This step is as simple as pointing and clicking--JavaStar does all the work. You can store all the declarations files for a test program in a package for convenience.

  2. You edit the declarations file to use abstracted names for the components. Instead of referring to a field by a number, you can reference it by name.

  3. You reference the declaration files at the time you record scripts, so that JavaStar automatically imports the declarations into the test it creates and records component references using the new abstracted names.

  4. When a component changes in the application, you open the file where the component declaration is stored, edit it to reflect the change, and then save and compile. All scripts that reference that component now automatically reference the new information.



Send feedback to JavaStar-feedback@suntest.com
Copyright © 1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303. All rights reserved.