Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need one way to setup/cleanup tests that works for both Platform TCK component TCKs + EE test mode #1420

Closed
scottmarlow opened this issue Jul 24, 2024 · 5 comments
Assignees
Labels
11.0 Issues related to the Jakarta EE 11 Platform TCK release

Comments

@scottmarlow
Copy link
Contributor

scottmarlow commented Jul 24, 2024

For EE testing, we need to support (https://github.com/jakartaee/platform-tck/blob/main/common/src/main/java/com/sun/ts/lib/harness/EETest.java) test setup/cleanup.

This issue is a compromise to support both the new @BeforeEach/AfterEach way for component TCKs but still allow the old way for EE Test setup/cleanup.

@scottmarlow scottmarlow added the 11.0 Issues related to the Jakarta EE 11 Platform TCK release label Jul 24, 2024
@scottmarlow
Copy link
Contributor Author

One concern with using @BeforeEach/AfterEach for EE testing is ensuring that the BeforeEach method is not called too soon and that the AfterEach method is also called at the right time.

@scottmarlow
Copy link
Contributor Author

To identify the TCK tests that need changes:

grep -rli org.junit.jupiter.api.BeforeEach
grep -rli org.junit.jupiter.api.AfterEach

Specifications for which the TCK tests need updates (to BeforeEach/AfterEach methods):

The changes needed are to support EE testing:

  1. Each BeforeEach method needs to check a system property indicates Jakarta EE deployment is being used and that the @BeforeEach public void _setup() throws Exception { } method should return right away. Otherwise, the public void setup() throws Exception should be called. The EE testing layer will directly call the public void setup() throws Exception method which doesn't check for the EE system property.
  2. Do the same for each AfterEach method.

The test changes should be done in a way that doesn't change any test logic in already balloted component specifications.

Note that there are 566 references to BeforeEach as per grep -rli org.junit.jupiter.api.BeforeEach --include=*.java| wc -l
Note that there are 358 references to AfterEach as per grep -rli org.junit.jupiter.api.AfterEach --include=*.java| wc -l

@scottmarlow scottmarlow self-assigned this Jul 25, 2024
@scottmarlow
Copy link
Contributor Author

scottmarlow commented Jul 25, 2024

Note that some tests still use https://github.com/jakartaee/platform-tck/blob/main/common/src/main/java/com/sun/ts/lib/harness/SetupMethod.java annotation to mark the test setup method and https://github.com/jakartaee/platform-tck/blob/main/common/src/main/java/com/sun/ts/lib/harness/CleanupMethod.java to mark the test cleanup method.

But these tests are not currently being tested yet.

@gurunrao
Copy link
Contributor

gurunrao commented Jul 31, 2024

To identify the TCK tests that need changes:

grep -rli org.junit.jupiter.api.BeforeEach
grep -rli org.junit.jupiter.api.AfterEach

Specifications for which the TCK tests need updates (to BeforeEach/AfterEach methods):

* https://jakarta.ee/specifications/expression-language/6.0/ which is new for EE 11

* https://jakarta.ee/specifications/persistence/3.2 which is new for EE 11

* https://jakarta.ee/specifications/websocket/2.2 which is new for EE 11

* https://jakarta.ee/specifications/pages/4.0 which is new for EE 11

The changes needed are to support EE testing:

1. Each BeforeEach method needs to check a system property indicates Jakarta EE deployment is being used and that the `@BeforeEach  public void _setup() throws Exception { }` method should return right away.  Otherwise, the `public void setup() throws Exception` should be called.  The EE testing layer will directly call the `public void setup() throws Exception` method which doesn't check for the EE system property.

2. Do the same for each AfterEach method.

The test changes should be done in a way that doesn't change any test logic in already balloted component specifications.

Note that there are 566 references to BeforeEach as per grep -rli org.junit.jupiter.api.BeforeEach --include=*.java| wc -l Note that there are 358 references to AfterEach as per grep -rli org.junit.jupiter.api.AfterEach --include=*.java| wc -l

Pages, Websocket Platform TCK tests does not run in an Test Vehicle. Alwin has raised PR #1425 for EL to restore JavaTest classes for Platform TCK.For Persistence, should we restore Javatest classes, as done for JMS?

@starksm64 starksm64 moved this to In progress in Jakarta EE11 TCK Release Jul 31, 2024
@scottmarlow
Copy link
Contributor Author

Pages, Websocket Platform TCK tests does not run in an Test Vehicle. Alwin has raised PR #1425 for EL to restore JavaTest classes for Platform TCK.For Persistence, should we restore Javatest classes, as done for JMS?

As discussed on the Platform TCK call today for EE 11, we should restore the JavaTest classes for Persistence as a new Platform TCK test folder.

The current https://github.com/jakartaee/platform-tck/tree/main/jpa folder source will be dedicated to the (component/standalone) Persistence/JPA TCK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11.0 Issues related to the Jakarta EE 11 Platform TCK release
Projects
Status: Done
Development

No branches or pull requests

3 participants