Skip to content

Commit

Permalink
HSEARCH-4522 Simplify test configuration common to all JDKs above JDK11
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere committed Apr 1, 2022
1 parent 47aa32d commit e6ae366
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 114 deletions.
20 changes: 1 addition & 19 deletions integrationtest/mapper/orm-batch-jsr352/pom.xml
Expand Up @@ -17,6 +17,7 @@

<surefire.jvm.args.module>
${test.elasticsearch.connection.jvm.args}
${test.weld.jvm.args}
</surefire.jvm.args.module>
</properties>

Expand Down Expand Up @@ -177,24 +178,5 @@
</plugins>
</build>

<profiles>
<profile>
<id>testWithJdk11+</id>
<activation>
<property>
<name>java-version.test.release</name>
<value>!8</value>
</property>
</activation>
<properties>
<!-- Weld performs illegal accesses to java.base to generate proxies, so we need to allow them -->
<surefire.jvm.args.module>
--add-opens java.base/java.security=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
</surefire.jvm.args.module>
</properties>
</profile>
</profiles>

</project>

25 changes: 6 additions & 19 deletions integrationtest/mapper/orm-cdi/pom.xml
Expand Up @@ -12,6 +12,12 @@
<name>Hibernate Search ITs - ORM - CDI</name>
<description>Hibernate Search integration tests for the Hibernate ORM integration with CDI</description>

<properties>
<surefire.jvm.args.module>
${test.weld.jvm.args}
</surefire.jvm.args.module>
</properties>

<dependencies>
<dependency>
<groupId>org.hibernate.search</groupId>
Expand Down Expand Up @@ -62,24 +68,5 @@
</plugins>
</build>

<profiles>
<profile>
<id>testWithJdk11+</id>
<activation>
<property>
<name>java-version.test.release</name>
<value>!8</value>
</property>
</activation>
<properties>
<!-- Weld performs illegal accesses to java.base to generate proxies, so we need to allow them -->
<surefire.jvm.args.module>
--add-opens java.base/java.security=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
</surefire.jvm.args.module>
</properties>
</profile>
</profiles>

</project>

20 changes: 1 addition & 19 deletions jakarta/integrationtest/mapper/orm-batch-jsr352/pom.xml
Expand Up @@ -19,6 +19,7 @@

<surefire.jvm.args.module>
${test.elasticsearch.connection.jvm.args}
${test.weld.jvm.args}
</surefire.jvm.args.module>
</properties>

Expand Down Expand Up @@ -182,24 +183,5 @@
</plugins>
</build>

<profiles>
<profile>
<id>testWithJdk11+</id>
<activation>
<property>
<name>java-version.test.release</name>
<value>!8</value>
</property>
</activation>
<properties>
<!-- Weld performs illegal accesses to java.base to generate proxies, so we need to allow them -->
<surefire.jvm.args.module>
--add-opens java.base/java.security=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
</surefire.jvm.args.module>
</properties>
</profile>
</profiles>

</project>

23 changes: 4 additions & 19 deletions jakarta/integrationtest/mapper/orm-cdi/pom.xml
Expand Up @@ -14,6 +14,10 @@

<properties>
<transform.original.pathFromRoot>integrationtest/mapper/orm-cdi</transform.original.pathFromRoot>

<surefire.jvm.args.module>
${test.weld.jvm.args}
</surefire.jvm.args.module>
</properties>

<dependencies>
Expand Down Expand Up @@ -69,24 +73,5 @@
</plugins>
</build>

<profiles>
<profile>
<id>testWithJdk11+</id>
<activation>
<property>
<name>java-version.test.release</name>
<value>!8</value>
</property>
</activation>
<properties>
<!-- Weld performs illegal accesses to java.base to generate proxies, so we need to allow them -->
<surefire.jvm.args.module>
--add-opens java.base/java.security=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
</surefire.jvm.args.module>
</properties>
</profile>
</profiles>

</project>

20 changes: 1 addition & 19 deletions orm6/integrationtest/mapper/orm-batch-jsr352/pom.xml
Expand Up @@ -19,6 +19,7 @@

<surefire.jvm.args.module>
${test.elasticsearch.connection.jvm.args}
${test.weld.jvm.args}
</surefire.jvm.args.module>
</properties>

Expand Down Expand Up @@ -182,24 +183,5 @@
</plugins>
</build>

<profiles>
<profile>
<id>testWithJdk11+</id>
<activation>
<property>
<name>java-version.test.release</name>
<value>!8</value>
</property>
</activation>
<properties>
<!-- Weld performs illegal accesses to java.base to generate proxies, so we need to allow them -->
<surefire.jvm.args.module>
--add-opens java.base/java.security=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
</surefire.jvm.args.module>
</properties>
</profile>
</profiles>

</project>

23 changes: 4 additions & 19 deletions orm6/integrationtest/mapper/orm-cdi/pom.xml
Expand Up @@ -14,6 +14,10 @@

<properties>
<transform.original.pathFromRoot>integrationtest/mapper/orm-cdi</transform.original.pathFromRoot>

<surefire.jvm.args.module>
${test.weld.jvm.args}
</surefire.jvm.args.module>
</properties>

<dependencies>
Expand Down Expand Up @@ -69,24 +73,5 @@
</plugins>
</build>

<profiles>
<profile>
<id>testWithJdk11+</id>
<activation>
<property>
<name>java-version.test.release</name>
<value>!8</value>
</property>
</activation>
<properties>
<!-- Weld performs illegal accesses to java.base to generate proxies, so we need to allow them -->
<surefire.jvm.args.module>
--add-opens java.base/java.security=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
</surefire.jvm.args.module>
</properties>
</profile>
</profiles>

</project>

12 changes: 12 additions & 0 deletions pom.xml
Expand Up @@ -505,6 +505,7 @@
<failsafe.jvm.args.jacoco></failsafe.jvm.args.jacoco>
<!-- JVM args to be customized by each Maven module -->
<surefire.jvm.args.module></surefire.jvm.args.module>
<surefire.jvm.args.module.add-opens></surefire.jvm.args.module.add-opens>
<!--
Pass these properties as system properties to be able to switch to
a different database without re-compiling the hibernate.properties file
Expand Down Expand Up @@ -612,6 +613,14 @@
<test.database.run.mssql.image.name>mcr.microsoft.com/mssql/server</test.database.run.mssql.image.name>
<test.database.run.mssql.image.tag>2019-CU8-ubuntu-16.04</test.database.run.mssql.image.tag>

<!-- Property whose sole purpose is to be referenced in the definition of surefire.jvm.args.module
when Weld is used. -->
<!-- Weld performs illegal accesses to java.base to generate proxies, so we need to allow them. -->
<test.weld.jvm.args>
--add-opens java.base/java.security=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
</test.weld.jvm.args>

<!-- Eclipse plugin options -->

<m2e.apt.activation>jdt_apt</m2e.apt.activation>
Expand Down Expand Up @@ -2357,6 +2366,9 @@
<properties>
<surefire.jvm.args.java-version></surefire.jvm.args.java-version>
<maven.compiler.failOnWarning>false</maven.compiler.failOnWarning>
<!-- JDK 8 doesn't support the add-opens mentioned in the default value of this property,
but it doesn't need them either, so we just omit them. -->
<test.weld.jvm.args></test.weld.jvm.args>
</properties>
</profile>

Expand Down

0 comments on commit e6ae366

Please sign in to comment.