使用ant的junit系统属性
我的ant脚本有问题! 在jUnit测试中,我必须使用System.getProperty设置一个字符串。 当我使用eclipse和vm参数时,一切正常,但使用ant脚本时,我无法传递系统属性 下面是我的ant代码片段:使用ant的junit系统属性,ant,properties,junit,system,Ant,Properties,Junit,System,我的ant脚本有问题! 在jUnit测试中,我必须使用System.getProperty设置一个字符串。 当我使用eclipse和vm参数时,一切正常,但使用ant脚本时,我无法传递系统属性 下面是我的ant代码片段: <junit fork="yes" haltonfailure="false" showoutput="true"> <sysproperty key="sdkpath" value="some path"/> o
<junit fork="yes" haltonfailure="false" showoutput="true">
<sysproperty key="sdkpath" value="some path"/>
or
<jvmarg value="-Dsdk_path=/some path/"/>
<batchtest fork="false" todir="${execution.home}">
<fileset dir="${basedir}/src">
<include name="**/**Test*.java" />
<exclude name="**/MonkeyTest.java"/>
</fileset>
</batchtest>
<formatter type="xml" usefile="true" />
<classpath refid="test.classpath" />
</junit>
或
更改
<batchtest fork="false" todir="${execution.home}">
到
真奇怪。我做了那个改变,它在我这边奏效了。请检查您是否能够读取测试用例中的其他系统属性(例如java.version)的值。
<batchtest todir="${execution.home}">