【发布时间】:2011-11-16 03:46:44
【问题描述】:
当我执行这段代码时:
Object[] segments = new Object[2];
segments[0] = // JUnit Test Class 1
segments[1] = // JUnit Test Class 2
TreePath treepath = new TreePath(segments);
TreeSelection treeselection = new TreeSelection(treepath);
JUnitLaunchShortcut j = new JUnitLaunchShortcut();
j.launch(treeselection, ILaunchManager.RUN_MODE);
Eclipse/JUnit Plugin 只执行JUnit Test Class 2,也许执行了两个Test Class 但只显示在JUnit 查看最后一个Test Class(也许)......
你怎么看?如何“启动”所有测试类?
【问题讨论】:
-
请accept回答您之前的问题。
-
我检查了 JUnitLaunchShortcut 代码并验证了代码转换 TreeSelection 为 IStructuredSelection 并调用 launch(Object[] elements, String mode) ...在整个过程中 ILaunchConfigurationWorkingCopy 只能setAttribute 进行一项测试,但我需要进行 N 次测试... :( 如何创建 ILaunchConfigurationWorkingCopy 来运行多个测试?!或者,如何为 VMArg 添加多个 ILaunchConfigurationWorkingCopy?
-
经过很多小时,我认为不可能做我想做的事...... Eclipse的RunConfiguration不支持运行我选择的几个测试用例!只运行一个 SingleTestClass 或一个 Project、Package 或 SourceFolder,不运行来自多个包的多个测试用例. (我很难过:()
标签: eclipse eclipse-plugin junit