Skip to content

Commit

Permalink
Update documentation for new TCK refactoring
Browse files Browse the repository at this point in the history
Signed-off-by: Arjan Tijms <arjan.tijms@omnifish.ee>
  • Loading branch information
arjantijms committed Apr 30, 2024
1 parent 7973794 commit 2f4d136
Show file tree
Hide file tree
Showing 5 changed files with 5,798 additions and 30 deletions.
35 changes: 24 additions & 11 deletions tck-dist/userguide/src/main/jbake/content/config.inc
Expand Up @@ -49,19 +49,32 @@ and configuration to support your implementation and Arqulillian container imple
starts up your container and deploys the test wars into it.


4.3 Setting up an Evironment Against a Jakarta EE {JakartaEEVersion} CI for legacy TCK tests
4.3 Setting up an Evironment Against a Jakarta EE {JakartaEEVersion} CI for SPI TCK tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The legacy tests which are part of the latest Jakarta Authentication TCK use `KEYWORDS` parameter to identify the
tests that need to be executed for JakartaEE Full and Web profile implementations. The tck/old-tck/run/pom.xml includes
example of using the profiles `platform` (for JakartaEE Platform - Full profile by default) and `web` (for Web Profile)
that sets the appropirate values for `KEYWORDS` in the CI.
The SPI tests (in [tck]/spi which are part of the latest Jakarta Authentication TCK need additional configuration.

```
For JakartaEE Platform Full profile , KEYWORDS = jaspic_baseline|javaee
For JakartaEE Platform Web platform , KEYWORDS = jaspic_web_profile
```
These SPI tests dive a little deeper into the assertions of the Jakarta Authentication SPI, and directly test for a number of
technical expectations. In contrast, most other tests in the Jakarta Authentication TCK look more at observable system
behavior and are more akin to Integration Tests (IT).

The common sub-module ([tck]/spi/module) of the SPI module primarily contains a special AuthConfigFactory (the TSSV) that is installed
using a ServletContainerInitializer. This AuthConfigFactory traces a lot of operations
on it to a logging file (saved to location set by system property "log.file.location").
This logging file is read by the (client side) tests, which verify whether specific entries are present or absent in said log file.

Both the CI (e.g. Eclipse GlassFish) and the client environment running the tests (junit) needs to have this "log.file.location" specified and
pointing to the same location.

Among the SPI tests is a test for the "auth context ID", which can be obtained in a standard way, but contains an implementation specific
value. In order to test that this value is correct, the expected value for a CI needs to be configured using the client environment
system property "logical.hostname.servlet".

A Jakarta Authentication implementation provides an "AuthConfigFactory" implementation, which can be obtained in a standard way, but
obviously is of a implementation specific type. In order to test various assumptions about this "vendor AuthConfigFactory", the exact type
needs to be provided to the tests via the system property "vendor.authconfig.factory". Both the CI (e.g. GlassFish) and the client
environment running the tests (junit) needs to have this "vendor.authconfig.factory" specified and set to the same value.

The `tck/old-tck/source/src/com/sun/ts/lib/harness/keyword.properties` has the full list of keywords
mapped to the test directories in tck/old-tck/
The `tck/pom.xml` file contains a full example for Eclipse GlassFish in the "glassfish-ci-managed" profile in the surefire configuration
section.

2 changes: 1 addition & 1 deletion tck-dist/userguide/src/main/jbake/content/toc.adoc
Expand Up @@ -71,7 +71,7 @@ link:using.html#GBFWO[5 Executing Tests]
** link:using.html#GBFWM[5.2 Running a Subset of the Tests]
*** link:using.html#GBFWK[5.2.1 To Run a Subset of Tests in Command-Line Mode]
** link:using.html#GCLRR[5.3 Running the TCK Against GlassFish]
** link:using.html#GDMSS[5.4 Running the Legacy TCK tests Against GlassFish]
[[debugging-test-problems]]
link:debug.html#GBFUV[6 Debugging Test Problems]
Expand Down
19 changes: 1 addition & 18 deletions tck-dist/userguide/src/main/jbake/content/using.adoc
Expand Up @@ -102,27 +102,10 @@ The tests in the directory are run.

All the tests can be run against GlassFish by
invoking the following from the tck/ directory:
`mvn clean verify`. This will include the legacy
TCK JavaTest based tests in tck/old-tck.
`mvn clean verify`.


[[GDMSS]][[running-the-tck-against-the-glassfish]]

5.4 Running the Legacy TCK tests Against GlassFish
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The legacy JavaTest based TCK tests are in tck/old-tck folder.
They can be run by below:

1. Change to the directory tck/old-tck.
2. Start the test run by executing the following command: +
+
[source]
----
mvn clean verify
----
+
The legacy JavaTest based TCK tests in the directory are run.

include::using.inc[]

0 comments on commit 2f4d136

Please sign in to comment.