Testing using Java

Currently the abs-maven-plugin provide goal 'javatest' to support execution of ABS unit tests (test code resides at $project.basedir/src/test/abs by default) in Java and interpreting the Java execution output.

To run ABSUnit test in Java from ABS in a ABS Maven project, include the following plugin declaration inside the <build><plugins>...</plugins></build> section of the pom.xml

<plugin>
  <groupId>eu.hats-project</groupId>
  <artifactId>abs-maven-plugin</artifactId>
  <version>1.0-SNAPSHOT</version>
  <executions>
    <execution>
      <id>abs-test</id>
      <goals>
        <goal>javatest</goal>
      </goals>
      <configuration>
        ... (see optional configuration for detail) ...
      </configuration>
    </execution>
  </executions>
</plugin>

Optional configuration goal javatest

  • absTestFolder, ABS test folder, default is $project.basedir/src/test/abs
  • absJavaBackendTestTargetFolder, Generated Java folder, default is $project.basedir/target/abs/gen/test
  • generateRunner, whether to generate ABSUnit test runner (.abs file containing a main block that executes all specified ABSUnit tests concurrently.
  • absTestRunnerFile, the file to which the generated ABSUnit test runner is written, default is $project.basedir/target/abs/gen/abs/runner.abs
  • productName, build given product by applying deltas (productName is a string that is the qualified product ID)

To test the source of the ABS Maven project, invoke the 'test' goal

mvn test