Using a Modular Approach: Running Tests


Running a JST is a little different than running a script. When you run a script, the Record/Playback window shows you the script as it executes, highlighting each line. Because a script has only one file, it's more obvious where you are while the test runs. But for JSTs, JavaStar is opening and closing various tests. To help you track where the test is executing, JavaStar opens a JST Runner window.

The JST Runner shows the graph of your JST just as you created it in the Test Composer. As each node executes, the JST Runner flashes that node. When JavaStar encounters a node that is a JST itself, it begins tracking that JST in the JST Runner. When the nested JST finishes executing, the JST Runner displays the upper-level JST and continues where it left off.

The Record/Playback window still shows the code of each script as it executes. The only difference is that now the JST Runner shows you which script is being executed in the Record/Playback window.

Running a JST

  1. Copy the original sesame.db to test.db, replacing the existing file.

  2. In the JavaStar main menu, click Run test.

  3. For the test name, type Acceptance.jst.

  4. Click Start.
    JavaStar launches the test application, opens the Record/Playback window, and also opens the JST Runner window to show the progress through the JST as it runs. You may need to move the windows around at the beginning so you can see the JST Runner.

    JST Runner showing a graphic display of the currently executing test

  5. When the test finishes, quit the Record/Playback window.
    This closes the application and JST Runner windows as well.

Debugging a Test

If run test stops before the JST finishes, note which node is flashing in the JST Runner window. Check the log file display in Record/Playback window to see what the error is. If it can't find the file, you might have misspelled the node name either when you created the node or the recorded the script.

To debug the problem:

  1. Stop playback in the Record/Playback window.

  2. Close the JST Runner.

  3. Click Playback and enter the name of the node (JST or script) where the test stopped.

  4. Examine the test while it executes and try to determine the problem.
    If you can't find anything wrong with the test, check the previous node. It's possible that the previous node didn't leave the application in the proper state for this node to execute properly. For example, if one of the scripts didn't clear the display before adding a record, the data it enters would then be mixed with that already in the first record of the database.



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