Generating and Using Declarations: Generating Component Declarations


  1. Use Create Script to start the test program and launch the Record/Playback window.
    Refer to the section Starting Your Application or Applet in the chapter "Preparing to Use JavaStar" for instructions.

  2. In the Record/Playback window, click the Declarations button.
    An instruction dialog opens. Note that the Record/Playback window displays "Generate Component Declarations" in the status area, and the test program now accepts interaction.

    Generate declarations instruction dialog

  3. Move your pointer over a component (usually a frame), then press Ctrl-Alt-F10, or Ctrl-Shift-F10, to generate declarations.
    A Generate Declarations dialog (see Figure 6-2) prompts you for the name of the package and class where JavaStar will write the declarations.

    Note - After moving your pointer over a window, you can use Ctrl-Alt-F10, Ctrl-Shift-F10, or Ctrl-Meta-F10 to generate declarations. If you are using a UNIX platform and Ctrl-Alt-F10 does not work, try Ctrl-Shift-F10. You can also use Ctrl-Meta-F10. The Meta key on UNIX keyboards is next to the spacebar, marked with a diamond symbol.

    Generate Declarations

  4. If you want JavaStar to create a package for your classes, type the name into the Package field.
    If you supply a package name, JavaStar creates a directory with this name within the current work directory. If you're generating declarations for all the windows of your test program, storing them in a package can make it easier to maintain and reference the declarations for an entire test suite.
    If you do not supply a package name, JavaStar saves all component declaration classes from this process into the work directory. JavaStar creates one .java file for each window you select.

    Note - If you do use a package name, you'll need to add the directory to your additional classpath, in recording and later in playback.

  5. Type the class name you want to use for this declarations file into the Class field.
    JavaStar creates a .java file with the class name you enter. However, if the declarations file is loaded for the current session, the newly generated declarations files won't take effect immediately.

  6. Click OK.

  7. To generate component declarations for other frames or dialogs in your application, bring them up and repeat steps Step 3--Step 6.
    You can step through all frames of your test program and create component declaration classes for each one. Because the declarations for each frame are saved to a separate class, you can quickly detect changes and update portions of the component declarations at a later time.

  8. Click Stop.



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