
j.Use the FinalQuestion marker to identify the last question in the sub- interview.
At the end of the
The following code in the SampleInterview example identifies the final question in the
Question qXXX = ......... {
Question getNext() { return qEnd;
}
};
Question qEnd = new FinalQuestion(this);
The following SampleInterview.java class is used for the example in the Simple Test Suite. It puts everything together that was described in Step a through Step j.
public class SampleInterview extends Interview {
public SampleInterview(MidpTckBaseInterview parent) throws Fault { super(parent, "sample");
setResourceBundle("i18n");
setHelpSet("help/sampleInterview");
first = new StringQuestion(this, "hello"); first.setExporter( Exporters.getStringValueExporter("sample.string.value")); first.linkTo(end); setFirstQuestion(firstQuestion);
}
private StringQuestion first;
private final FinalQuestion end = new FinalQuestion(this, "end");
}
You can also view the SampleInterview.java file in the following location:
SimpleTestSuite/src/sample/suite
Chapter 3 Test Suite Construction 35