§ 而且必须以test冠以函数名
要演示的例子当中可以看到的手动添加的函数有两个,一个是testDialog(),另一个是testAllComponentsInit()。先看testDialog()这个函数:
public final void testDialog() {
JDialog dialog;
java.util.List showingWindows;
NamedComponentFinder finder = new NamedComponentFinder(
JComponent.class, "OKButton");
JButton okButton = (JButton) finder.find(demo, 0);
assertNotNull("Could not find the OK button", okButton);
DialogFinder dFinder = new DialogFinder(demo.getTitle());
showingWindows = dFinder.findAll();
dialog = (JDialog) showingWindows.get(0);