Merge pull request #31078 from bdshadow

* pr/31078:
  Polish "Fix spring-orm tests with eclipselink and Java 18+"
  Fix spring-orm tests with eclipselink and Java 18+

Closes gh-31078
This commit is contained in:
Stéphane Nicoll 2023-10-24 16:50:34 +02:00
commit 1022e090e7
4 changed files with 1 additions and 10 deletions

View File

@ -116,7 +116,7 @@ dependencies {
api("org.crac:crac:1.4.0") api("org.crac:crac:1.4.0")
api("org.dom4j:dom4j:2.1.4") api("org.dom4j:dom4j:2.1.4")
api("org.eclipse.jetty:jetty-reactive-httpclient:4.0.0") api("org.eclipse.jetty:jetty-reactive-httpclient:4.0.0")
api("org.eclipse.persistence:org.eclipse.persistence.jpa:3.0.3") api("org.eclipse.persistence:org.eclipse.persistence.jpa:3.0.4-RC1")
api("org.eclipse:yasson:2.0.4") api("org.eclipse:yasson:2.0.4")
api("org.ehcache:ehcache:3.10.8") api("org.ehcache:ehcache:3.10.8")
api("org.ehcache:jcache:1.0.1") api("org.ehcache:jcache:1.0.1")

View File

@ -23,13 +23,11 @@ import jakarta.persistence.EntityManager;
import jakarta.persistence.Query; import jakarta.persistence.Query;
import jakarta.persistence.TransactionRequiredException; import jakarta.persistence.TransactionRequiredException;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledForJreRange;
import org.springframework.orm.jpa.domain.Person; import org.springframework.orm.jpa.domain.Person;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.junit.jupiter.api.condition.JRE.JAVA_18;
/** /**
* An application-managed entity manager can join an existing transaction, * An application-managed entity manager can join an existing transaction,
@ -39,7 +37,6 @@ import static org.junit.jupiter.api.condition.JRE.JAVA_18;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.0 * @since 2.0
*/ */
@DisabledForJreRange(min = JAVA_18, disabledReason = "These JPA tests don't pass on Java 18+")
public class ApplicationManagedEntityManagerIntegrationTests extends AbstractEntityManagerFactoryIntegrationTests { public class ApplicationManagedEntityManagerIntegrationTests extends AbstractEntityManagerFactoryIntegrationTests {
@Test @Test

View File

@ -24,7 +24,6 @@ import jakarta.persistence.PersistenceException;
import jakarta.persistence.Query; import jakarta.persistence.Query;
import jakarta.persistence.TransactionRequiredException; import jakarta.persistence.TransactionRequiredException;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledForJreRange;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException; import org.springframework.dao.DataAccessException;
@ -34,7 +33,6 @@ import org.springframework.orm.jpa.domain.Person;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException; import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
import static org.junit.jupiter.api.condition.JRE.JAVA_18;
/** /**
* Integration tests using in-memory database for container-managed JPA * Integration tests using in-memory database for container-managed JPA
@ -43,7 +41,6 @@ import static org.junit.jupiter.api.condition.JRE.JAVA_18;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.0 * @since 2.0
*/ */
@DisabledForJreRange(min = JAVA_18, disabledReason = "These JPA tests don't pass on Java 18+")
public class ContainerManagedEntityManagerIntegrationTests extends AbstractEntityManagerFactoryIntegrationTests { public class ContainerManagedEntityManagerIntegrationTests extends AbstractEntityManagerFactoryIntegrationTests {
@Autowired @Autowired

View File

@ -18,20 +18,17 @@ package org.springframework.orm.jpa.eclipselink;
import org.eclipse.persistence.jpa.JpaEntityManager; import org.eclipse.persistence.jpa.JpaEntityManager;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledForJreRange;
import org.springframework.orm.jpa.AbstractContainerEntityManagerFactoryIntegrationTests; import org.springframework.orm.jpa.AbstractContainerEntityManagerFactoryIntegrationTests;
import org.springframework.orm.jpa.EntityManagerFactoryInfo; import org.springframework.orm.jpa.EntityManagerFactoryInfo;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.condition.JRE.JAVA_18;
/** /**
* EclipseLink-specific JPA tests. * EclipseLink-specific JPA tests.
* *
* @author Juergen Hoeller * @author Juergen Hoeller
*/ */
@DisabledForJreRange(min = JAVA_18, disabledReason = "These JPA tests don't pass on Java 18+")
public class EclipseLinkEntityManagerFactoryIntegrationTests extends AbstractContainerEntityManagerFactoryIntegrationTests { public class EclipseLinkEntityManagerFactoryIntegrationTests extends AbstractContainerEntityManagerFactoryIntegrationTests {
@Test @Test