Creating projects¶
Starting a new project¶
In case you are starting a new Maven Java Junit project from scratch, a Maven archetype is provided to help
you generate a correctly structured project with recommended dependencies. The archetetype group Id is
org.squashtest.ta.galaxia
, the archetype artifact Id is squash-tf-junit-runner-project-achetype
and
the current version is 1.0.0-RELEASE
. Hence, to use it simply run the following command :
mvn archetype:generate -DarchetypeGroupId=org.squashtest.ta.galaxia -DarchetypeArtifactId=squash-tf-junit-runner-project-archetype -DarchetypeVersion=1.0.0-RELEASE
Tests implementation: sample with SoapUI Smartbear Api¶
Once your project is created, you just have to implement your tests as Junit tests according to the version of Junit chosen.
Here is an example to run a REST test with the open source API proposed by SoapUI Smartbear.
We used:
- a REST test given in the tutorial installed with version 5.5.0 of SoapUI Smartbear software.
- the open source SoapUI Smartbear API version 5.1.3
- the TF JUnit runner version 1.0.0-RELEASE
- junit (jupiter) version 5.2.0
We have set in the POM’s project the version of junit chosen:
You need to add the external dependency the SoapUI API in your POM file as follows:
In this example, you must also add in your POM a block for the Smartbear repository:
Create your test class and implement it. Your project now looks like this:
Launch the TF junit runner:
The HTML results file of the execution squash-ta-report.html
is available in the subdirectory squashTA/html-report of the target folder.
Note: If you have not started the server mock, as indicated in the SoapUI tutorial, your test will fail on a connection error.