home *** CD-ROM | disk | FTP | other *** search
Java Source | 1999-02-11 | 1.4 KB | 46 lines |
- /* Generated by JavaStar Java GUI Testing Tool
- */
-
- import suntest.javastar.lib.*;
- import java.awt.*;
-
- public class OpenFile extends Script {
-
-
- private static String[] Args = {};
- public String[] getAppArgs(){ return Args; }
-
- public String getAppClass(){ return "namedb"; }
-
- public void run() throws Throwable {
- namedb.main(Args);
- }
-
- public void play(String[] args) throws Throwable {
-
- // Validate 2 or more parameters were passed
- if (args.length < 2) {
- System.err.println("OpenFile: requires 2 params: <file> <# of entries>");
- return;
- }
-
- // convert the 2nd parameter to an int
- int size=new Integer(args[1]).intValue();
-
- // Get the internal API
- namedb thenamedb = (namedb)JS.frame("Name Database").member("namedb").getValidUnique();
- RoloApi api=thenamedb.getRoloApi();
-
- NameData.MainWin.Open().buttonPress();
-
- NameData.MainWin.frame().dialog("Open").relativefile(".", args[0]);
-
- NameData.MainWin.frame().member("java.awt.Label", "Name Database - " + args[0]).waitFor("Name Database - " + args[0], "Proceed only if correct file loaded");
-
- // test the correct number of entries were found
- JS.check( size == api.getSize(), "verify expected number of entries found");
-
- // Print out information since JS.check cannot show what we are comparing
- System.out.println("checking size: expected="+size+" actual="+api.getSize()); }
- }
-