Merge pull request #1162 from jamesagnew/test-openjdk-11

Test openjdk 11
This commit is contained in:
James Agnew 2019-01-09 13:48:53 -05:00 committed by GitHub
commit 17ac097050
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 169 additions and 56 deletions

View File

@ -8,8 +8,9 @@ dist: trusty
language: java
jdk:
- oraclejdk9
# - openjdk11
- openjdk11
#- oraclejdk9
env:
global:
- MAVEN_OPTS="-Xmx10244M -Xss128M -XX:MetaspaceSize=512M -XX:MaxMetaspaceSize=1024M -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC"
@ -30,4 +31,4 @@ before_script:
script:
# - mvn -e -B clean install && cd hapi-fhir-ra && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID clean test jacoco:report coveralls:report
# - mvn -Dci=true -e -B -P ALLMODULES,NOPARALLEL,ERRORPRONE clean install && cd hapi-fhir-jacoco && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID jacoco:report coveralls:report
- mvn -Dci=true -e -B -P ALLMODULES,REDUCED_JPA_TESTS,ERRORPRONE,JACOCO clean install && cd hapi-fhir-jacoco && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID jacoco:report coveralls:report;
- mvn -Dci=true -e -B -P ALLMODULES,REDUCED_JPA_TESTS,JACOCO clean install && cd hapi-fhir-jacoco && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID jacoco:report coveralls:report;

View File

@ -1687,6 +1687,9 @@ public class XmlUtil {
XMLInputFactory inputFactory;
try {
inputFactory = XMLInputFactory.newInstance();
if (inputFactory.isPropertySupported(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES)) {
inputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, true);
}
throwUnitTestExceptionIfConfiguredToDoSo();
} catch (Throwable e) {
throw new ConfigurationException("Unable to initialize StAX - XML processing is disabled", e);

View File

@ -2,6 +2,7 @@ package ca.uhn.fhir.jpa.provider.r4;
import ca.uhn.fhir.jpa.dao.DaoConfig;
import ca.uhn.fhir.jpa.dao.IFhirResourceDao;
import ca.uhn.fhir.jpa.provider.r4.BaseResourceProviderR4Test;
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
import ca.uhn.fhir.jpa.util.ExpungeOptions;
import ca.uhn.fhir.rest.api.server.IBundleProvider;

View File

@ -88,7 +88,6 @@
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
@ -112,6 +111,12 @@
<artifactId>jscience</artifactId>
</dependency>
<!-- Java -->
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</dependency>
<!-- Testing -->
<dependency>

View File

@ -93,6 +93,12 @@
<scope>test</scope>
</dependency>
<!-- Java -->
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</dependency>
<!-- Spring -->
<dependency>
<groupId>aopalliance</groupId>

View File

@ -17,8 +17,12 @@
<properties>
<features.file>features.xml</features.file>
<pax-logging-version>1.8.6</pax-logging-version>
<felix-framework-version>3.2.2</felix-framework-version>
<pax_logging_version>1.10.1</pax_logging_version>
<felix_framework_version>3.2.2</felix_framework_version>
<osgi_version>6.0.0</osgi_version>
<configadmin_version>1.9.10</configadmin_version>
<aries_blueprint_api_version>1.0.1</aries_blueprint_api_version>
<aries_blueprint_core_version>1.10.1</aries_blueprint_core_version>
</properties>
<dependencies>
@ -87,43 +91,43 @@
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>4.3.1</version>
<version>${osgi_version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
<version>${pax-logging-version}</version>
<version>${pax_logging_version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-service</artifactId>
<version>${pax-logging-version}</version>
<version>${pax_logging_version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
<version>${felix-framework-version}</version>
<version>${felix_framework_version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.configadmin</artifactId>
<version>1.8.8</version>
<version>${configadmin_version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.aries.blueprint</groupId>
<artifactId>org.apache.aries.blueprint.api</artifactId>
<version>1.0.1</version>
<version>${aries_blueprint_api_version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.aries.blueprint</groupId>
<artifactId>org.apache.aries.blueprint.core</artifactId>
<version>1.0.1</version>
<version>${aries_blueprint_core_version}</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -56,12 +56,8 @@
<feature name='hapi-fhir-hl7org-dstu2' version='${project.version}' start-level='50'>
<feature version='${project.version}'>hapi-fhir</feature>
<feature version='${project.version}'>hapi-fhir-utilities</feature>
<bundle dependency='true'>
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon/${servicemix_saxon_version}
</bundle>
<bundle dependency='true'>
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver/${servicemix_xmlresolver_version}
</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon/${servicemix_saxon_version}</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver/${servicemix_xmlresolver_version}</bundle>
<bundle>mvn:ca.uhn.hapi.fhir/hapi-fhir-structures-hl7org-dstu2/${project.version}</bundle>
</feature>
@ -84,18 +80,17 @@
</feature>
<feature name='hapi-fhir-ph-schematron' version='${project.version}' start-level='50'>
<bundle dependency='true'>
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon/${servicemix_saxon_version}
</bundle>
<bundle dependency='true'>
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver/${servicemix_xmlresolver_version}
</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon/${servicemix_saxon_version}</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver/${servicemix_xmlresolver_version}</bundle>
<bundle dependency="true">mvn:org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle/${aries_spifly_version}</bundle>
<bundle dependency='true'>mvn:com.google.code.findbugs/jsr305/${jsr305_version}</bundle>
<bundle dependency='true'>mvn:com.helger/ph-commons/${ph_commons_version}</bundle>
<bundle dependency='true'>mvn:com.helger/ph-collection/${ph_commons_version}</bundle>
<!-- needed by ph-xml 9.1.1, will be removed in later versions -->
<bundle dependency='true'>mvn:javax.jws/javax.jws-api/1.1</bundle>
<bundle dependency='true'>mvn:com.helger/ph-xml/${ph_commons_version}</bundle>
<bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl/${jaxb_bundle_version}</bundle>
<bundle start-level="20">mvn:com.sun.xml.bind/jaxb-impl/${jaxb_core_version}</bundle>
<bundle start-level="20">mvn:com.sun.xml.bind/jaxb-core/${jaxb_core_version}</bundle>
<bundle dependency='true'>mvn:com.helger/ph-jaxb/${ph_commons_version}</bundle>
<bundle dependency='true'>mvn:com.helger/ph-schematron/${ph_schematron_version}</bundle>
</feature>

View File

@ -33,7 +33,7 @@
</description>
<properties>
<pax.exam.version>4.12.0</pax.exam.version>
<pax.exam.version>4.13.1</pax.exam.version>
</properties>
<dependencies>
@ -97,7 +97,11 @@
<artifactId>hapi-fhir-validation</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.ops4j.pax.url</groupId>
<artifactId>pax-url-aether</artifactId>
<version>2.5.4</version>
</dependency>
<!-- karaf test -->
<dependency>
@ -125,8 +129,8 @@
<type>tar.gz</type>
<exclusions>
<exclusion>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
@ -146,19 +150,36 @@
</dependency>
<dependency>
<groupId>org.apache.karaf.features</groupId>
<artifactId>enterprise</artifactId>
<artifactId>standard</artifactId>
<version>${apache_karaf_version}</version>
<classifier>features</classifier>
<type>xml</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.hamcrest</artifactId>
<version>1.3_1</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<dependency>
<groupId>org.apache.karaf.features</groupId>
<artifactId>enterprise</artifactId>
<version>${apache_karaf_version}</version>
<classifier>features</classifier>
<type>xml</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.hamcrest</artifactId>
<version>1.3_1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
@ -181,6 +202,9 @@
<configuration>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<systemPropertyVariables>
<karaf.version>${apache_karaf_version}</karaf.version>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>

View File

@ -1,12 +1,19 @@
package ca.uhn.fhir.tests.integration.karaf;
import org.ops4j.pax.exam.CoreOptions;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.karaf.container.internal.JavaVersionUtil;
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption;
import org.ops4j.pax.exam.karaf.options.LogLevelOption;
import org.ops4j.pax.exam.options.DefaultCompositeOption;
import org.ops4j.pax.exam.options.extra.VMOption;
import java.io.File;
import java.net.ServerSocket;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
import static org.ops4j.pax.exam.CoreOptions.when;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
@ -16,15 +23,51 @@ import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
public enum PaxExamOptions {
KARAF(
karafDistributionConfiguration()
.frameworkUrl(
maven()
.groupId("org.apache.karaf")
.artifactId("apache-karaf")
.versionAsInProject()
.type("zip"))
.name("Apache Karaf")
.useDeployFolder(false)
.unpackDirectory(new File("target/paxexam/unpack/")),
.frameworkUrl(
maven()
.groupId("org.apache.karaf")
.artifactId("apache-karaf")
.versionAsInProject()
.type("tar.gz"))
.name("Apache Karaf")
.useDeployFolder(false)
.unpackDirectory(new File("target/paxexam/unpack/")),
when(JavaVersionUtil.getMajorVersion() >= 9)
.useOptions(
systemProperty("pax.exam.osgi.unresolved.fail").value("true"),
systemProperty("java.awt.headless").value("true"),
KarafDistributionOption.logLevel(LogLevelOption.LogLevel.INFO),
KarafDistributionOption.editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", Integer.toString(getAvailablePort(9080, 9999))),
KarafDistributionOption.editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiRegistryPort", Integer.toString(getAvailablePort(1099, 9999))),
KarafDistributionOption.editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiServerPort", Integer.toString(getAvailablePort(44444, 66666))),
KarafDistributionOption.editConfigurationFilePut("etc/org.apache.karaf.shell.cfg", "sshPort", Integer.toString(getAvailablePort(8101, 8888))),
new VMOption("--add-reads=java.xml=java.logging"),
new VMOption("--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED"),
new VMOption("--patch-module"),
new VMOption("java.base=lib/endorsed/org.apache.karaf.specs.locator-"
+ System.getProperty("karaf.version", "4.2.2") + ".jar"),
new VMOption("--patch-module"),
new VMOption("java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-"
+ System.getProperty("karaf.version", "4.2.2") + ".jar"),
new VMOption("--add-opens"),
new VMOption("java.base/java.security=ALL-UNNAMED"),
new VMOption("--add-opens"),
new VMOption("java.base/java.net=ALL-UNNAMED"),
new VMOption("--add-opens"),
new VMOption("java.base/java.lang=ALL-UNNAMED"),
new VMOption("--add-opens"),
new VMOption("java.base/java.util=ALL-UNNAMED"),
new VMOption("--add-opens"),
new VMOption("java.naming/javax.naming.spi=ALL-UNNAMED"),
new VMOption("--add-opens"),
new VMOption("java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"),
new VMOption("--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED"),
new VMOption("--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED"),
new VMOption("--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED"),
new VMOption("--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED"),
new VMOption("-classpath"),
new VMOption("lib/jdk9plus/*" + File.pathSeparator + "lib/boot/*")
),
keepRuntimeFolder(),
configureConsole().ignoreLocalConsole(),
logLevel(LogLevelOption.LogLevel.INFO)
@ -33,7 +76,7 @@ public enum PaxExamOptions {
features(
maven()
.groupId("org.apache.karaf.features")
.artifactId("enterprise")
.artifactId("standard")
.type("xml")
.classifier("features")
.versionAsInProject(),
@ -136,6 +179,18 @@ public enum PaxExamOptions {
this.options = options;
}
public static int getAvailablePort(int min, int max) {
for (int i = min; i <= max; i++) {
try (ServerSocket socket = new ServerSocket(i)) {
return socket.getLocalPort();
} catch (Exception e) {
System.err.println("Port " + i + " not available, trying next one");
continue; // try next port
}
}
throw new IllegalStateException("Can't find available network ports");
}
public Option option() {
return new DefaultCompositeOption(options);
}

View File

@ -54,6 +54,7 @@ import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.karaf.options.LogLevelOption;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerClass;
@ -76,6 +77,7 @@ import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
import static org.ops4j.pax.exam.CoreOptions.options;
import static org.ops4j.pax.exam.CoreOptions.when;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.debugConfiguration;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;
/**
@ -97,7 +99,8 @@ public class Dstu3JsonParserTest {
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.hamcrest").versionAsInProject(),
when(false)
.useOptions(
debugConfiguration("5005", true))
debugConfiguration("5005", true)),
logLevel(LogLevelOption.LogLevel.DEBUG)
);
}

25
pom.xml
View File

@ -510,8 +510,8 @@
<!-- Dependency Versions -->
<activation_api_version>1.2.0</activation_api_version>
<apache_karaf_version>4.1.6</apache_karaf_version>
<aries_spifly_version>1.0.10</aries_spifly_version>
<apache_karaf_version>4.2.2</apache_karaf_version>
<aries_spifly_version>1.2</aries_spifly_version>
<caffeine_version>2.6.2</caffeine_version>
<commons_codec_version>1.11</commons_codec_version>
<commons_text_version>1.6</commons_text_version>
@ -542,13 +542,12 @@
<resteasy_version>4.0.0.Beta3</resteasy_version>
<ph_schematron_version>5.0.4</ph_schematron_version>
<ph_commons_version>9.1.1</ph_commons_version>
<plexus_compiler_api_version>2.8.4</plexus_compiler_api_version>
<plexus_compiler_api_version>2.8.5</plexus_compiler_api_version>
<servicemix_saxon_version>9.5.1-5_1</servicemix_saxon_version>
<servicemix_xmlresolver_version>1.2_5</servicemix_xmlresolver_version>
<slf4j_version>1.7.25</slf4j_version>
<spring_version>5.1.3.RELEASE</spring_version>
<spring_data_version>2.1.3.RELEASE</spring_data_version>
<!--<spring-boot.version>1.5.6.RELEASE</spring-boot.version>-->
<spring-boot.version>2.1.1.RELEASE</spring-boot.version>
<stax2_api_version>3.1.4</stax2_api_version>
@ -640,7 +639,7 @@
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
@ -1378,10 +1377,11 @@
<maxmem>2000m</maxmem>
</configuration>
<dependencies>
<!--
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
@ -1403,6 +1403,7 @@
<artifactId>plexus-utils</artifactId>
<version>3.1.0</version>
</dependency>
-->
</dependencies>
</plugin>
<plugin>
@ -2299,7 +2300,17 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerId>javac-with-errorprone</compilerId>
<compilerArgs>
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.3.2</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>

View File

@ -7,6 +7,11 @@
</properties>
<body>
<release version="3.7.0" date="TBD" description="Gale">
<action type="add">
HAPI FHIR is now built using OpenJDK 11. Users are recommended to upgrade to this version
of Java if this is feasible. We are not yet dropping support for Java 8 (aka 1.8), although
we may do so in an upcoming release.
</action>
<action type="add">
The version of a few dependencies have been bumped to the
latest versions (dependent HAPI modules listed in brackets):