-
Notifications
You must be signed in to change notification settings - Fork 112
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
Added AutoCloseable tests for EntityManagerFactory and EntityManager. #759
Conversation
Signed-off-by: Tomas Kraus <tomas.kraus@oracle.com>
Well guys, I'm even not a commiter here. So if someone from TCK team want's to do the cleanup, you are welcome to do that. I just want to add test to verify new API change in JPA 3.1 spec and all I can do is to follow current coding style (which I don't like as well). |
Signed-off-by: Tomas Kraus <tomas.kraus@oracle.com>
I'll keep this test as draft until assertion IDs are resolved properly. Asked Alwin for some help with this. |
👍 on checking for possible NPE. |
For reference https://github.com/eclipse-ee4j/jakartaee-tck/wiki/Steps-to-generate-the-html-version-of-the-SpecAssertions.xml describes how to generate the assertions.html version of a SpecAssertions.xml input file but I'm not sure of when we need to run that versus manually updating the assertions.html files. @lukasj should these new AutoCloseable tests use a JavaDoc (for https://github.com/eclipse-ee4j/jpa-api/blob/master/api/src/main/java/jakarta/persistence/EntityManager.java + https://github.com/eclipse-ee4j/jpa-api/blob/master/api/src/main/java/jakarta/persistence/EntityManagerFactory.java) or SPEC (for https://github.com/eclipse-ee4j/jpa-api/blob/master/spec/src/main/asciidoc/ch07-entitymanagers-and-persistence-contexts.adoc) assertion ID? |
@scottmarlow Do you have a pointer to docs describing what these assertions are good for/how they should be written? |
The assertions in the test description seems to be api assertions or javadoc ids. I have added a script in eclipse-ee4j/jakartaee-tck-tools#9 that was used to generate the javadoc assertions from javadocs (Thanks to Jan). Tomas would help trying this script to generate the javadoc ids for jpa. IMO it would be sufficient to use the api assertion for the existing apis that were modified in this PR. Finding the right javadoc assertion id for the changed methods is required. https://github.com/eclipse-ee4j/jakartaee-tck/blob/master/install/jpa/docs/assertions/api/api-assertions-3_0.html has the api assertions for the previous release.
The https://github.com/eclipse-ee4j/jakartaee-tck/wiki/Steps-to-generate-the-html-version-of-the-SpecAssertions.xml only provides instructions to generate the html version of the already existing spec assertion xml files. |
I'll draft something up on https://github.com/eclipse-ee4j/jakartaee-tck/wiki/Guide-to-adding-Specification-Assertions and start a discussion thread for the same on the Platform TCK ML. |
I tried to create new API assertions list for 3.1.0 but there was no information about |
Signed-off-by: Tomas Kraus <tomas.kraus@oracle.com>
Just keep in mind, that this is JPA 3.1 modification and JPA 3.1 is needed for build/run. Artifacts are available at https://jakarta.oss.sonatype.org/content/repositories/staging/jakarta/persistence/jakarta.persistence-api/3.1.0-RC1/ |
Signed-off-by: Tomas Kraus <tomas.kraus@oracle.com>
I built the JPA 3.1 spec source locally and see From jpa-api/spec/target/generated-docs/jakarta-persistence-spec-3.1-SNAPSHOT.html#jakarta-persistence-3-1:
From jpa-api/spec/target/generated-docs/jakarta-persistence-spec-3.1-SNAPSHOT.html#a1066 (
From file:///home/smarlow/work/jakarta/jpa-api/spec/target/generated-docs/jakarta-persistence-spec-3.1-SNAPSHOT.html#entitymanagerfactory-interface (
I also looked at javadoc via https://jakarta.oss.sonatype.org/content/repositories/staging/jakarta/persistence/jakarta.persistence-api/3.1.0-RC1/jakarta.persistence-api-3.1.0-RC1-javadoc.jar to see possible options for assertions based on that: The jakarta.persistence/jakarta/persistence/EntityManagerFactory.html has:
The jakarta.persistence/jakarta/persistence/EntityManager.html has:
I suggest that api-assertions-3_0.html should have two new rows at the end added with:
And:
The internal/docs/jpa/Persistence31JavadocAssertions.xml should be updated to include the new IDs (the new tests should be updated to use the new IDs). For the description field, it would be good to say more than I did, if anyone feels creative (perhaps based on wording in https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html). |
Looks like we should also increment |
I'm not sure why PERSISTENCE:JAVADOC:29 is now PERSISTENCE:JAVADOC:29__OLD in internal/docs/jpa/Persistence31JavaDocAssertions.html, @Tomas-Kraus was that a hint that some action needs to be done to the https://github.com/eclipse-ee4j/jakartaee-tck/blob/master/src/com/sun/ts/tests/jpa/core/annotations/entity/Client.java#L65 source that references It looks like you corrected some entries and kept the original entries with the |
@Tomas-Kraus The entries with the cc @jansupol |
I'll push a change to remove the __OLD entries. |
Signed-off-by: Tomas Kraus <tomas.kraus@oracle.com>
PR #793 contains spec assertion IDs update for 3.1. I changed assertion IDs in AutoCloseable tests to point to
|
Think we can merge this now. |
Signed-off-by: Tomas Kraus tomas.kraus@oracle.com
name: Pull Request
about: Create a pull request for a Platform TCK change
title: 'Added AutoCloseable tests for EntityManagerFactory and EntityManager'
labels: ''
assignees: ''
Fixes Issue
#730
Related Issue(s)
N/A
Describe the change
Added autoCloseableTest into EMF anf EM test clients.
Additional context
N/A
CC @alwin-joseph @anajosep @arjantijms @cesarhernandezgt @dblevins @m0mus @edbratt @gurunrao @jansupol @jgallimore @kazumura @kwsutter @LanceAndersen @bhatpmk @RohitKumarJain @shighbar @gthoman @brideck @scottmarlow