This PR is to migrate the signature tests to new REST standalone tck from jakartaee-tck repository.
We are using the same framework to run the signature tests as from jakartaee-tck. But the procedure to generate and run the tests are changed from both TCK developer and user perspective. Also we are using the sigtest-maven-plugin.jar for generating and running the signature tests, which is available in maven central repository.
Major changes in this repo compared to that of jakartaee-tck
We use sigtest-maven-plugin.jar from maven instead of sigtest.jar and sigtestdev.jar to generate and run the signature tests.
The signature, mapping and the package list files are now renamed to jakarta.ws.rs.sig_${version}, sig-test.map, sig-test-pkg-list.txt files respectively.
The property names are now renamed and need to be set as System properties instead of in ts.jte file. There is no ts.jte file in the new TCK.
Changes are made to remove dependency on JTharness and run the test as Junit.
For TCK developers (jaxrs-api team now) :-
Generate Signature Files : The signature file will have to be generated by the TCK team using jaxrs-tck/pom.xml by running mvn install -Precord-signature. The classpath should contain the api jar for which we are generating the signature file.
The signature file name expected is jakarta.ws.rs.sig_${version} , where version is the api version for which the signature is generated.
Place the required files in the TCK folder :
All the below files has to be placed in the folder jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/signaturetest, so they are included as part of the TCK jar during the build.
The signature file generated from above of the name jakarta.ws.rs.sig_${version}
The mapping file will be named sig-test.map, it contains the api to version mapping. This file will be used to pick the right signature file when running the signature test.
The package list file will be named sig-test-pkg-list.txt, contains the list of packages tested.
For TCK users (to run the signature test as a Junit test) :-
The signature test related files will need to be extracted from the jar to a known location to be used for running the test.
For eg: in maven we can use the below code to extract the signature file, mapping file and package list file to ${project.build.directory}/signaturedirectory as done in this PR.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.2.0</version>
<execution>
<id>copy-jaxrs-tck-signature-files</id>
<phase>generate-test-sources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-tck</artifactId>
<version>3.1-SNAPSHOT</version>
<type>jar</type>
<overWrite>true</overWrite>
</artifactItem>
</artifactItems>
<!-- We need the signature file, mapping file and package list file -->
<includes>**/*sig-test*,**/*jakarta.ws.rs.sig_*</includes>
<outputDirectory>${project.build.directory}/signaturedirectory</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
We would need to set the below system properties correctly :
jimage.dir //The jdk9+(jdk11 for this release) will be extracted to this location as to use the Java modules in the path.
optional.tech.packages.to.ignore // The optional package that should be ignored while running the signature test
signature.mapfile //The full path of the signature mapping file
signature.repositoryDir // The directory where the signature file is placed.
signature.packagelist //The full path of the list of packages that will be tested.
signature.sigTestClasspath // the sigTestClasspath that will contain the implementation jar that needs to be tested along with dependent jars.
This PR is to migrate the signature tests to new REST standalone tck from jakartaee-tck repository.
We are using the same framework to run the signature tests as from jakartaee-tck. But the procedure to generate and run the tests are changed from both TCK developer and user perspective. Also we are using the sigtest-maven-plugin.jar for generating and running the signature tests, which is available in maven central repository.
Major changes in this repo compared to that of jakartaee-tck
For TCK developers (jaxrs-api team now) :-
mvn install -Precord-signature
. The classpath should contain the api jar for which we are generating the signature file.The signature file name expected is
jakarta.ws.rs.sig_${version}
, whereversion
is the api version for which the signature is generated.All the below files has to be placed in the folder jaxrs-tck/src/main/resources/jakarta/ws/rs/tck/signaturetest, so they are included as part of the TCK jar during the build.
jakarta.ws.rs.sig_${version}
For TCK users (to run the signature test as a Junit test) :-
${project.build.directory}/signaturedirectory
as done in this PR.For eg: they are set in this PR as below.
mvn clean verify -Parq-glassfish-managed -Dit.test=jakarta.ws.rs.tck.signaturetest.**
Can you please review this and suggest your opinions on this. @jansupol @gurunrao @spericas @scottmarlow