如何使用eclipse中的Ant运行Junit插件测试

时间:2015-02-11 02:55:02

标签: ant eclipse-plugin eclipse-rcp junit4

我们如何使用来自eclipse的ant运行junit插件测试,也可以从命令提示符运行?我使用的是Junit4.4。

1 个答案:

答案 0 :(得分:1)

org.eclipse.test插件提供了一个library.xml文件,其中包含用于在UI(ui-test目标)和无头(core-test目标)模式下运行插件测试的ant任务。在下面调用任务的示例中,您需要提供一些属性来配置您自己的环境并检查org.eclipse.test插件版本:

<property name="library-file"
    value="${eclipse-home}/plugins/org.eclipse.test_3.2.0/library.xml" />

...

    <ant target="ui-test" antfile="${library-file}"
        dir="${eclipse-home}">
        <property name="data-dir" value="${workspace}" />
        <property name="plugin-name" value="${plugin-name}" />
        <property name="classname"
            value="com.example.MyTestSuite" />
        <property name="junit-report-output" value="${results.dir}"/>
    </ant>
相关问题