2013-09-30 40 views
0

TestNG的財產「delegateCommandSystemProperties」是不是與Maven保命插件工作。TestNG的財產「delegateCommandSystemProperties」萬無一失

我試圖運行在使用命名參數的testng.xml檢驗單「計數」

Eventhough我傳遞變量如下

mvn test -Dcount=2 -Dtest=<XXXXXX> 

拋出的錯誤是

參數「計數」是必需由@Test上方法XXXXXX但尚未 被標記@optional或定義

有沒有人試圖使用maven surefire的delegateCommandSystemProperties?

pom.xml的片斷,我配置了性能

<plugin> 
     <artifactId>maven-surefire-plugin</artifactId> 
     <configuration> 
      <suiteXmlFiles> 
       <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile> 
      </suiteXmlFiles> 
      <properties> 
       <property> 
       <name>delegateCommandSystemProperties</name> 
       <value>true</value> 
       </property> 
      </properties> 
      : 
      : 

概括地說,我需要幫助,從Maven的萬無一失命令傳遞參數TestNG的測試!

回答

0

delegateCommandSystemProperties是一個ant任務。爲了通過參數從行家萬無一失以下命令行的方式是

mvn test -DargLine="-Dcount=2"