这可能有点矛盾。但我需要运行一个基本上显示java编辑器/视图等的“测试”,并让用户与视图进行交互,而无需启动剩余的应用程序。非终止java ui测试?
喜欢的东西:
public static void main(String[] args) {
Display display = new Display();
final Shell shell = new Shell(display);
shell.setSize(500, 500);
shell.setLayout(new RowLayout());
shell.setText("Composite Example");
final Composite composite = new Composite(shell, SWT.NONE);
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 4;
composite.setLayout(gridLayout);
// Here the view is shown
MyExample sdf = new MyExample(composite, SWT.NONE);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
是否有这样做(如使用JUnit)来创建这些用户交互测试,用户必须手动启动和终止的更系统的方式?