Browse Source

Polishing

pull/30183/head
Sam Brannen 3 years ago
parent
commit
18adf905a8
  1. 10
      gradle/toolchains.gradle
  2. 6
      spring-core/src/test/java/org/springframework/core/SpringCoreBlockHoundIntegrationTests.java
  3. 4
      spring-orm/src/test/java/org/springframework/orm/jpa/ApplicationManagedEntityManagerIntegrationTests.java
  4. 4
      spring-orm/src/test/java/org/springframework/orm/jpa/ContainerManagedEntityManagerIntegrationTests.java
  5. 4
      spring-orm/src/test/java/org/springframework/orm/jpa/eclipselink/EclipseLinkEntityManagerFactoryIntegrationTests.java

10
gradle/toolchains.gradle

@ -5,10 +5,10 @@
* One can choose the toolchain to use for compiling the MAIN sources and/or compiling * One can choose the toolchain to use for compiling the MAIN sources and/or compiling
* and running the TEST sources. These options apply to Java, Kotlin and Groovy sources * and running the TEST sources. These options apply to Java, Kotlin and Groovy sources
* when available. * when available.
* {@code "./gradlew check -PmainToolchain=17 -PtestToolchain=19"} will use: * {@code "./gradlew check -PmainToolchain=17 -PtestToolchain=20"} will use:
* <ul> * <ul>
* <li>a JDK17 toolchain for compiling the main SourceSet * <li>a JDK17 toolchain for compiling the main SourceSet
* <li>a JDK19 toolchain for compiling and running the test SourceSet * <li>a JDK20 toolchain for compiling and running the test SourceSet
* </ul> * </ul>
* *
* By default, the build will fall back to using the current JDK and 17 language level for all sourceSets. * By default, the build will fall back to using the current JDK and 17 language level for all sourceSets.
@ -23,9 +23,9 @@
* {@code * {@code
* $ echo JDK17 * $ echo JDK17
* /opt/openjdk/java17 * /opt/openjdk/java17
* $ echo JDK19 * $ echo JDK20
* /opt/openjdk/java18 * /opt/openjdk/java20
* $ ./gradlew -Porg.gradle.java.installations.fromEnv=JDK17,JDK19 check * $ ./gradlew -Porg.gradle.java.installations.fromEnv=JDK17,JDK20 check
* } * }
* *
* @author Brian Clozel * @author Brian Clozel

6
spring-core/src/test/java/org/springframework/core/SpringCoreBlockHoundIntegrationTests.java

@ -21,8 +21,7 @@ import java.util.concurrent.CompletableFuture;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnJre; import org.junit.jupiter.api.condition.DisabledForJreRange;
import org.junit.jupiter.api.condition.JRE;
import reactor.blockhound.BlockHound; import reactor.blockhound.BlockHound;
import reactor.core.scheduler.ReactorBlockHoundIntegration; import reactor.core.scheduler.ReactorBlockHoundIntegration;
import reactor.core.scheduler.Schedulers; import reactor.core.scheduler.Schedulers;
@ -31,6 +30,7 @@ import org.springframework.util.ConcurrentReferenceHashMap;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.condition.JRE.JAVA_18;
/** /**
* Tests to verify the spring-core BlockHound integration rules. * Tests to verify the spring-core BlockHound integration rules.
@ -47,7 +47,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
* @author Sam Brannen * @author Sam Brannen
* @since 5.2.4 * @since 5.2.4
*/ */
@DisabledOnJre(value= {JRE.JAVA_18, JRE.JAVA_19, JRE.JAVA_20}, disabledReason = "BlockHound is not compatible with Java 18+") @DisabledForJreRange(min = JAVA_18, disabledReason = "BlockHound is not compatible with Java 18+")
class SpringCoreBlockHoundIntegrationTests { class SpringCoreBlockHoundIntegrationTests {
@BeforeAll @BeforeAll

4
spring-orm/src/test/java/org/springframework/orm/jpa/ApplicationManagedEntityManagerIntegrationTests.java

@ -24,12 +24,12 @@ 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.DisabledOnJre; import org.junit.jupiter.api.condition.DisabledOnJre;
import org.junit.jupiter.api.condition.JRE;
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 +39,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.0 * @since 2.0
*/ */
@DisabledOnJre(value = JRE.JAVA_18) @DisabledOnJre(JAVA_18)
public class ApplicationManagedEntityManagerIntegrationTests extends AbstractEntityManagerFactoryIntegrationTests { public class ApplicationManagedEntityManagerIntegrationTests extends AbstractEntityManagerFactoryIntegrationTests {
@Test @Test

4
spring-orm/src/test/java/org/springframework/orm/jpa/ContainerManagedEntityManagerIntegrationTests.java

@ -25,7 +25,6 @@ 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.DisabledOnJre; import org.junit.jupiter.api.condition.DisabledOnJre;
import org.junit.jupiter.api.condition.JRE;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException; import org.springframework.dao.DataAccessException;
@ -35,6 +34,7 @@ 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 +43,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.0 * @since 2.0
*/ */
@DisabledOnJre(value = JRE.JAVA_18) @DisabledOnJre(JAVA_18)
public class ContainerManagedEntityManagerIntegrationTests extends AbstractEntityManagerFactoryIntegrationTests { public class ContainerManagedEntityManagerIntegrationTests extends AbstractEntityManagerFactoryIntegrationTests {
@Autowired @Autowired

4
spring-orm/src/test/java/org/springframework/orm/jpa/eclipselink/EclipseLinkEntityManagerFactoryIntegrationTests.java

@ -19,19 +19,19 @@ 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.DisabledOnJre; import org.junit.jupiter.api.condition.DisabledOnJre;
import org.junit.jupiter.api.condition.JRE;
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
*/ */
@DisabledOnJre(value = JRE.JAVA_18) @DisabledOnJre(JAVA_18)
public class EclipseLinkEntityManagerFactoryIntegrationTests extends AbstractContainerEntityManagerFactoryIntegrationTests { public class EclipseLinkEntityManagerFactoryIntegrationTests extends AbstractContainerEntityManagerFactoryIntegrationTests {
@Test @Test

Loading…
Cancel
Save