Junit test Running

This Mojo enables one to run a selection of, or all possible, Junit tests and report their execution. In order to do so one only needs to run the following command :

mvn clean compile test-compile org.squashtest.ta.galaxia:squash-tf-junit-runner-maven-plugin:1.0.0-RELEASE:run
  • mvn : launch Maven
  • clean : (Optional) One of Maven default goals that enables one to clean everything that has been previously build by Maven.
  • compile : One of Maven default goals that enables one to compile code that is stored in src/main.
  • test-compile : One of Maven default goals that enables one to compile code that is stored in src/test.
  • org.squashtest.ta.galaxia:squash-tf-junit-runner-maven-plugin:1.0.0-RELEASE:run : the actual running Mojo provided by Squash TF Java Junit Runner. It runs the Junit tests that can be discovered (in the Junit sense) in the code compiled during the “compile” and “test-compile” phases.

By default the whole collection of tests available in the project will be executed. A summary of the execution is reported and available at target/squashTA/html-reports/squash-ta-report.html . A more detailed version of the report providing context in the case of technical error is also produced and available at target/squashTA/html-details/squash-ta-report.html. Finally a surfire report is also produced and available at target/squashTA/surefire-reports/ .

If one wants to only run a subset of possible test one can provide a list of tests via the Maven property “tf.test.suite”. Two mechanism are possible:

  • Mimic TM-TF link and provide a list of selected test via a Json file. In this scenario the tf.test.suite parameter should be given the value “{file:testsuite.json}” and the testsuite.json should be put right to the project pom.
  • Provide a CSV like line, where qualified tests names are listed separated by semicolons

In both cases test convention should follow the one used by the listing Mojo and described in the Junit tests reference scheme section above.

Warning

If there are metadata syntax errors in the running test script(s), warning message(s) will be displayed in the console. (See Metadata in JUnit runner for more information about Metadata syntax conventions)