2016-08-11 6 views
0

指定したとおりReportNGのシステムサポートプロパティを使用したいhere testng.xmlファイルを使用してテストを実行しません。テストは、mavenコマンドラインでTestNGグループを指定することによって実行されます。生成されたreportngレポートへの影響はありませんtestng.xmlなしでサポートされているシステムプロパティを使用

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-surefire-plugin</artifactId> 
    <executions> 
     <execution> 
      <id>default-test</id> 
      <goals> 
       <goal>test</goal> 
      </goals> 
      <configuration> 
       <argLine>-Xmx2048m -XX:MaxPermSize=512m</argLine> 
       <properties> 
        <property> 
         <name>usedefaultlisteners</name> 
         <value>false</value> 
        </property> 
        <property> 
         <name>listener</name> 
         <value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value> 
        </property> 
       </properties> 
       <systemProperties> 
        <systemProperty> 
         <name>org.uncommons.reportng.frames</name> 
         <value>false</value> 
        </systemProperty> 
        <systemProperty> 
         <name>org.uncommons.reportng.title</name> 
         <value>OBS Test Report</value> 
        </systemProperty> 
       </systemProperties> 
       <systemPropertyVariables> 
        <target.host>${target_host}</target.host> 
        <target.port>22</target.port> 
       </systemPropertyVariables> 
      </configuration> 
     </execution> 
    </executions> 
</plugin> 

しかし性質org.uncommons.reportng.framesorg.uncommons.reportng.title - 私はpom.xmlファイルにReportNGシステムプロパティを指定しました。これらのプロパティはどこで指定する必要がありますか?

+0

どのようにMavenを実行していますか?使用しているコマンドを投稿できますか? – Tunaki

+0

ここにtestを実行するためのmavenコマンドがあります。 - '' '$ MAVEN_HOME/bin/mvn -DskipTests = false -Dgroups = Temp test -e''' – Tarun

答えて

0

私は、次のようのpom.xmlを使用して解決策を見つけた -

<plugins> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-surefire-plugin</artifactId> 
        <executions> 
         <execution> 
          <id>default-test</id> 
          <goals> 
           <goal>test</goal> 
          </goals> 
          <configuration> 
           <argLine>-Xmx2048m -XX:MaxPermSize=512m</argLine> 
           <properties> 
            <property> 
             <name>listener</name> 
             <value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value> 
            </property> 
           </properties> 
           <systemPropertyVariables> 
            <org.uncommons.reportng.title>OBS Test Suite</org.uncommons.reportng.title> 
            <org.uncommons.reportng.escape-output>false</org.uncommons.reportng.escape-output> 
           </systemPropertyVariables> 
          </configuration> 
         </execution> 
        </executions> 
       </plugin> 
      </plugins> 
関連する問題