How to run a Junit Plugin Test using Ant from eclipse

非 Y 不嫁゛ 提交于 2019-12-13 10:54:01

问题


How can we run a junit plugin test using ant from eclipse, also from command prompt? I'm using Junit4.4.


回答1:


The org.eclipse.test plugin provides a library.xml file that contains ant tasks for running plugin tests both in UI (ui-test target) and headless (core-test target) modes. Example of invoking the task below, you'll need to provide a few properties to suite your own environment and check the org.eclipse.test plugin version:

<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>


来源:https://stackoverflow.com/questions/28445795/how-to-run-a-junit-plugin-test-using-ant-from-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!