Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用ant的junit系统属性_Ant_Properties_Junit_System - Fatal编程技术网

使用ant的junit系统属性

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

我的ant脚本有问题! 在jUnit测试中,我必须使用System.getProperty设置一个字符串。 当我使用eclipse和vm参数时,一切正常,但使用ant脚本时,我无法传递系统属性

下面是我的ant代码片段:

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