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