Sun Microsystems 1.2 Telephone Accessories User Manual


 
Chapter 3 Test Suite Construction 31
a. Create a class (SampleInterview) that is a subtype of the Interview
class.
The following code creates the SampleInterview class.
b. Identify the new interview (SampleInterview) as a sub-interview of the
parent interview.
In the new sub-interview class, the constructor must take a reference to the
parent interview as an argument and pass this reference to the superclass
constructor. This identifies the interview as a sub-interview of the parent
interview.
The following code identifies SampleInterview as a sub-interview of
MidpTckBaseInterview.
c. (Optional) Identify the resource file and helpset file used by the sub-
interview.
By default, a sub-interview shares a resource file and More Info help files with
its parent interview. However, you can choose to use a different resource file
and helpset file.
The following code in the SampleInterview example specifies a different
resource file and helpset file.
In the example, "i18n" is the properties file updated in Step 4, and
sampleInterview is the More Info helpset file updated in Step 5.
public class SampleInterview extends Interview {
....
}
public class SampleInterview extends Interview {
public SampleInterview(MidpTckBaseInterview parent)
throws Fault {
super(parent, "sample");
}
public class SampleInterview extends Interview {
public SampleInterview(MidpTckBaseInterview parent)
throws Fault {
super(parent, "sample");
setResourceBundle("i18n");
setHelpSet("help/sampleInterview");
}
}