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

TCK should not set version on entity manually #637

Open
beikov opened this issue Jun 12, 2024 · 5 comments
Open

TCK should not set version on entity manually #637

beikov opened this issue Jun 12, 2024 · 5 comments
Labels
accepted Accepted certification request challenge TCK challenge

Comments

@beikov
Copy link

beikov commented Jun 12, 2024

The following list of tests is failing because the TCK assumes it can set a version property manually:

  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#intFieldTest
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#intPropertyTest
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#integerFieldTest
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#integerPropertyTest
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longClassFieldTest
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longClassPropertyTest
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longFieldTest
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longPropertyTest
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortClassFieldTest
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortClassPropertyTest
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortFieldTest
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortPropertyTest
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#timestampFieldTest
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#timestampPropertyTest

The problem is in the various createXTestData methods that pass a non-null value in the entity constructors for the version. According to the JPA spec section 3.4.2:

An entity may access the state of its version field or property or export a method for use by the application to access the version, but must not modify the version value.[32] With the exception noted in Section 4.10, only the persistence provider is permitted to set or update the value of the version attribute in the object.

So the TCK violates the rules of the specification by setting the version.

Hibernate ORM leverages the nullity to determine whether an entity instance is detached or transient, which should be ok according to the specification.

@beikov
Copy link
Author

beikov commented Jun 12, 2024

Here is the fix jakartaee/platform-tck#1325

The tests should be excluded from the 3.1 and 3.2 TCK.

@lukasj lukasj added challenge TCK challenge accepted Accepted certification request labels Jun 14, 2024
beikov added a commit to beikov/jakartaee-tck that referenced this issue Jun 14, 2024
@scottmarlow
Copy link
Contributor

scottmarlow commented Jun 19, 2024

List of Platform TCK tests for this challenge:

  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#intFieldTest_from_appmanaged
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#intFieldTest_from_appmanagedNoTx
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#intFieldTest_from_pmservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#intFieldTest_from_puservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#intFieldTest_from_stateful3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#intFieldTest_from_stateless3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#intPropertyTest_from_appmanaged
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#intPropertyTest_from_appmanagedNoTx
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#intPropertyTest_from_pmservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#intPropertyTest_from_puservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#intPropertyTest_from_stateful3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#intPropertyTest_from_stateless3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#integerFieldTest_from_appmanaged
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#integerFieldTest_from_appmanagedNoTx
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#integerFieldTest_from_pmservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#integerFieldTest_from_puservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#integerFieldTest_from_stateful3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#integerFieldTest_from_stateless3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#integerPropertyTest_from_appmanaged
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#integerPropertyTest_from_appmanagedNoTx
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#integerPropertyTest_from_pmservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#integerPropertyTest_from_puservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#integerPropertyTest_from_stateful3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#integerPropertyTest_from_stateless3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longClassFieldTest_from_appmanaged
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longClassFieldTest_from_appmanagedNoTx
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longClassFieldTest_from_pmservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longClassFieldTest_from_puservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longClassFieldTest_from_stateful3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longClassFieldTest_from_stateless3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longClassPropertyTest_from_appmanaged
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longClassPropertyTest_from_appmanagedNoTx
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longClassPropertyTest_from_pmservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longClassPropertyTest_from_puservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longClassPropertyTest_from_stateful3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longClassPropertyTest_from_stateless3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longFieldTest_from_appmanaged
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longFieldTest_from_appmanagedNoTx
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longFieldTest_from_pmservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longFieldTest_from_puservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longFieldTest_from_stateful3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longFieldTest_from_stateless3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longPropertyTest_from_appmanaged
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longPropertyTest_from_appmanagedNoTx
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longPropertyTest_from_pmservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longPropertyTest_from_puservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longPropertyTest_from_stateful3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#longPropertyTest_from_stateless3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortClassFieldTest_from_appmanaged
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortClassFieldTest_from_appmanagedNoTx
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortClassFieldTest_from_pmservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortClassFieldTest_from_puservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortClassFieldTest_from_stateful3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortClassFieldTest_from_stateless3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortClassPropertyTest_from_appmanaged
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortClassPropertyTest_from_appmanagedNoTx
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortClassPropertyTest_from_pmservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortClassPropertyTest_from_puservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortClassPropertyTest_from_stateful3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortClassPropertyTest_from_stateless3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortFieldTest_from_appmanaged
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortFieldTest_from_appmanagedNoTx
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortFieldTest_from_pmservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortFieldTest_from_puservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortFieldTest_from_stateful3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortFieldTest_from_stateless3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortPropertyTest_from_appmanaged
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortPropertyTest_from_appmanagedNoTx
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortPropertyTest_from_pmservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortPropertyTest_from_puservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortPropertyTest_from_stateful3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#shortPropertyTest_from_stateless3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#timestampFieldTest_from_appmanaged
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#timestampFieldTest_from_appmanagedNoTx
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#timestampFieldTest_from_pmservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#timestampFieldTest_from_puservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#timestampFieldTest_from_stateful3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#timestampFieldTest_from_stateless3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#timestampPropertyTest_from_appmanaged
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#timestampPropertyTest_from_appmanagedNoTx
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#timestampPropertyTest_from_pmservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#timestampPropertyTest_from_puservlet
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#timestampPropertyTest_from_stateful3
  • com/sun/ts/tests/jpa/core/annotations/version/Client.java#timestampPropertyTest_from_stateless3

scottmarlow added a commit to scottmarlow/jakartaee-tck that referenced this issue Jun 19, 2024
@scottmarlow
Copy link
Contributor

jakartaee/platform-tck#1334 is for Persistence 3.1 + Jakarta EE 10 Platform TCK

@scottmarlow
Copy link
Contributor

Any Persistence 3.2 test excludes should be done by updating the tckrefactor branch:

  • Add excluded tests to doc file jpa/docs/TCK-Exclude-List.txt
  • Update test methods to use org.junit.jupiter.api.Disabled
    @disabled
    @test
    public void testMethodName() throws Exception {

For reference see git commit 4eb2b298eaf2a954f3c7e38e1da2a8fb6c8f1b85

@scottmarlow
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Accepted certification request challenge TCK challenge
Projects
None yet
Development

No branches or pull requests

3 participants