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-7.1.2\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 27.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.