Manual

23.3
Maven

People who are using Apache Maven (http://maven.apache.org) as build system may easily integrate QF-Test in their build. This can be achieved by using the antrun plugin of Maven. A demo pom.xml file, where QF-Tests tests are executed in the test phase could look like this:

<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
  http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <artifactId>testant</artifactId>
  <packaging>jar</packaging>
  <name>testant</name>
  <groupId>de.qfs</groupId>
  <version>1</version>

  <properties>
   <qf.exe>"C:\Program Files\qfs\qftest\qftest-4.3.0\bin\qftest.exe"</qf.exe>
   <qf.reportfolder>qftest</qf.reportfolder>
   <qf.log>logFile.qrz</qf.log>
   <qf.suite>"c:\path\to\testsuite.qft"</qf.suite>
  </properties>

  <build>
    <plugins>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-antrun-plugin</artifactId>
              <executions>
                  <execution>
                      <phase>test</phase>
                      <configuration>
                          <tasks>
                              <exec executable="${qf.exe}">
                                  <arg value="-batch"/>
                                  <arg value="-report"/>
                                  <arg value="${qf.reportfolder}"/>
                                  <arg value="-runlog"/>
                                  <arg value="${qf.log}"/>
                                  <arg value="${qf.suite}"/>
                              </exec>
                          </tasks>
                      </configuration>
                      <goals>
                          <goal>run</goal>
                      </goals>
                  </execution>
              </executions>
          </plugin>
    </plugins>
  </build>

</project>
        
Example 23.2:  Maven build file pom.xml to execute a test-suite

In your project it might become required to run the tests during another build phase, than the configured test phase in the example. In this case you have to configure the plugin accordingly, like described in the Maven documentation.