Bugs in the graphical facilities of the JDK generally require
manual interaction with applets. Applet tests are written in much the
same way as the simple main
tests described above. The
primary differences are that a second "@" tag is given to indicate
that the test is an applet test, and an appropriate HTML file is
needed. For example, an AWT test named Foo.java
would
have the form:
/* @test 1.1 97/10/12 @bug 9876543 @run applet/manual Foo.html */ public class Foo extends java.awt.Applet { ... }
or
public class Foo extends javax.swing.JApplet { ... }
The @run
tag tells the harness how to run the test. The first
argument is the run type, applet
, followed by an option,
/manual
, that flags this test as a manual test requiring user
interaction. The remaining arguments to the @run
tag are passed
to the program in a manner appropriate to the run type. In this case, the test
will be run just as if the appletviewer
had been invoked on
Foo.html
. Thus Foo.html
must contain, at least, an
HTML applet
tag with any necessary parameters.