我想测试我的LaunchConfigurationDelegate,但是我无法模拟启动方法的eclipse类。我正在使用Mockito,当我运行测试时,我得到ILaunchConfiguration模拟的NoClassDefFoundError。测试看起来像这样
@Test
public void testLaunch() {
ILaunchConfiguration config = mock(ILaunchConfiguration.class);
ILaunch launch = mock(ILaunch.class);
IProgressMonitor monitor = mock(IProgressMonitor.class);
MyLaunchConfigurationDelegate launchDelegate = new MyLaunchConfigurationDelegate();
try {
launchDelegate.launch(config, "run", launch, monitor);
} catch (CoreException e) {
fail(e.getMessage());
}
}
如何测试启动器?