2012-01-15 173 views
1

我的螞蟻腳本有問題! 在我的jUnit測試中,我必須使用System.getProperty設置一個字符串。 一切正常,當我使用Eclipse和VM參數,但與Ant腳本我不能夠通過系統屬性...junit系統屬性與螞蟻

這裏我螞蟻片段:

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

回答

0

變化

<batchtest fork="false" todir="${execution.home}"> 

<batchtest todir="${execution.home}"> 
+0

沒有幫助 – 2012-01-16 07:23:15

+0

這就是奇怪。我做了這個改變,它在我的最後工作。你能否檢查一下你是否能夠在你的測試用例中讀取其他系統屬性(例如java.version)的值? – 2012-01-16 18:29:29