Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Oliver Egger 2020-06-05 17:55:01 +02:00
commit 72d250a40a
12 changed files with 85 additions and 77 deletions

View File

@ -10,11 +10,11 @@ pr:
strategy:
matrix:
linux:
imageName: "ubuntu-16.04"
# mac:
# imageName: "macos-10.14"
# windows:
# imageName: "vs2017-win2016"
imageName: 'ubuntu-latest'
mac:
imageName: "macos-10.15"
windows:
imageName: "windows-2019"
maxParallel: 3
pool:
@ -26,11 +26,10 @@ variables:
VERSION:
steps:
- bash: ls -la
- bash: pwd
# This task pulls the <version> value from the org.hl7.fhir.r5 project pom.xml file. All modules are released as
# the same version, at the same time, as defined in the root level pom.xml.
- task: PowerShell@2
condition: and(eq(variables.currentImage, 'ubuntu-latest'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
inputs:
targetType: 'inline'
script: |
@ -42,6 +41,7 @@ steps:
# Prints out the build version, for debugging purposes
- bash: echo Pulled version from pom.xml => $(version)
condition: and(eq(variables.currentImage, 'ubuntu-latest'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
# Azure pipelines cannot pass variables between pipelines, but it can pass files, so we
# pass the build id (ex: 1.1.13-SNAPSHOT) as a string in a file.
@ -51,12 +51,12 @@ steps:
echo $(version)
VERSION=$(version)
echo "$VERSION" > $(System.DefaultWorkingDirectory)/VERSION
condition: and(eq(variables.currentImage, 'ubuntu-16.04'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
condition: and(eq(variables.currentImage, 'ubuntu-latest'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
# Copies the VERSION file containing the build id (ex: 1.1.13-SNAPSHOT) to the staging directory
# This is done for release versions only.
- task: CopyFiles@2
condition: and(eq(variables.currentImage, 'ubuntu-16.04'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
condition: and(eq(variables.currentImage, 'ubuntu-latest'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: '$(System.Defaultworkingdirectory)'
@ -73,12 +73,12 @@ steps:
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'clean package'
goals: 'package'
# Upload test results to codecov
- script: bash <(curl https://codecov.io/bash) -t $(codecov)
displayName: 'codecov Bash Uploader'
condition: and(eq(variables.currentImage, 'ubuntu-16.04'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
condition: and(eq(variables.currentImage, 'ubuntu-latest'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
# Publishes the test results to build artifacts.
- task: PublishCodeCoverageResults@1
@ -87,12 +87,12 @@ steps:
codeCoverageTool: 'JaCoCo'
summaryFileLocation: '$(System.DefaultWorkingDirectory)/org.hl7.fhir.report/target/site/jacoco-aggregate/jacoco.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/org.hl7.fhir.report/target/site/jacoco-aggregate/'
condition: and(eq(variables.currentImage, 'ubuntu-16.04'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
condition: and(eq(variables.currentImage, 'ubuntu-latest'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
# Publishes the built Validator jar to build artifacts. Primarily for testing and debugging builds.
- task: PublishPipelineArtifact@1
displayName: 'Publish Validator jar'
condition: and(eq(variables.currentImage, 'ubuntu-16.04'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
condition: and(eq(variables.currentImage, 'ubuntu-latest'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
inputs:
targetPath: "$(System.DefaultWorkingDirectory)/org.hl7.fhir.validation/target/org.hl7.fhir.validation-$(version).jar"
artifactName: Validator
@ -102,7 +102,7 @@ steps:
# for each of the three release pipelines will cause conflicts.
# This is done for release versions only.
- task: PublishBuildArtifacts@1
condition: and(eq(variables.currentImage, 'ubuntu-16.04'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
condition: and(eq(variables.currentImage, 'ubuntu-latest'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
displayName: 'Publish Build Artifacts'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'

View File

@ -14,7 +14,6 @@ import org.hl7.fhir.r5.model.SearchParameter;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.ValueSet;
import org.hl7.fhir.utilities.cache.NpmPackage;
import org.hl7.fhir.utilities.cache.PackageCacheManager;
import org.hl7.fhir.utilities.cache.ToolsVersion;
public class DefinitionsLoader {

View File

@ -30,8 +30,8 @@ import org.hl7.fhir.r5.model.SearchParameter;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.cache.FilesystemPackageCacheManager;
import org.hl7.fhir.utilities.cache.NpmPackage;
import org.hl7.fhir.utilities.cache.PackageCacheManager;
import org.hl7.fhir.utilities.cache.ToolsVersion;
public class JavaCoreGenerator {
@ -66,7 +66,7 @@ public class JavaCoreGenerator {
String jid = "r5";
PackageCacheManager pcm = new PackageCacheManager(true, ToolsVersion.TOOLS_VERSION);
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager(true, ToolsVersion.TOOLS_VERSION);
System.out.println("Cache: "+pcm.getFolder());
System.out.println("Load hl7.fhir."+pid+".core");
NpmPackage npm = pcm.loadPackage("hl7.fhir."+pid+".core", version);

View File

@ -2992,6 +2992,16 @@ public class ProfileUtilities extends TranslatingUtilities {
private Cell genTypes(HierarchicalTableGenerator gen, Row r, ElementDefinition e, String profileBaseFileName, StructureDefinition profile, String corePath, String imagePath, boolean root) {
Cell c = gen.new Cell();
r.getCells().add(c);
if (e.hasContentReference()) {
ElementDefinition ed = getElementByName(profile.getSnapshot().getElement(), e.getContentReference());
if (ed == null)
c.getPieces().add(gen.new Piece(null, translate("sd.table", "Unknown reference to %s", e.getContentReference()), null));
else {
c.getPieces().add(gen.new Piece(null, translate("sd.table", "See ", ed.getPath()), null));
c.getPieces().add(gen.new Piece("#"+ed.getPath(), tail(ed.getPath()), ed.getPath()));
}
return c;
}
List<TypeRefComponent> types = e.getType();
if (!e.hasType()) {
if (root) { // we'll use base instead of types then
@ -3840,13 +3850,6 @@ public class ProfileUtilities extends TranslatingUtilities {
}
}
if (definition.hasContentReference()) {
ElementDefinition ed = getElementByName(profile.getSnapshot().getElement(), definition.getContentReference());
if (ed == null)
c.getPieces().add(gen.new Piece(null, translate("sd.table", "Unknown reference to %s", definition.getContentReference()), null));
else
c.getPieces().add(gen.new Piece("#"+ed.getPath(), translate("sd.table", "See %s", ed.getPath()), null));
}
if (definition.getPath().endsWith("url") && definition.hasFixed()) {
c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, "\""+buildJson(definition.getFixed())+"\"", null).addStyle("color: darkgreen")));
} else {

View File

@ -13,7 +13,7 @@ import org.hl7.fhir.r5.formats.IParser.OutputStyle;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.utils.FHIRPathEngine;
import org.hl7.fhir.utilities.cache.PackageCacheManager;
import org.hl7.fhir.utilities.cache.FilesystemPackageCacheManager;
import org.hl7.fhir.utilities.cache.ToolsVersion;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@ -25,7 +25,7 @@ public class XmlParserTests {
@BeforeAll
public static void setUp() throws Exception {
PackageCacheManager pcm = new PackageCacheManager(true, ToolsVersion.TOOLS_VERSION);
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager(true, ToolsVersion.TOOLS_VERSION);
context = SimpleWorkerContext.fromPackage(pcm.loadPackage("hl7.fhir.r4.core", "4.0.1"));
fp = new FHIRPathEngine(context);

View File

@ -603,7 +603,7 @@ public class BaseValidator {
}
if (fr == null)
fr = ValueSetUtilities.generateImplicitValueSet(reference);
timeTracker.tx(t, System.nanoTime());
timeTracker.tx(t);
return fr;
}
} else

View File

@ -25,27 +25,26 @@ public class TimeTracker {
return fpeTime;
}
public void load(long t, long nanoTime) {
// TODO Auto-generated method stub
public void load(long start) {
loadTime = loadTime + (System.nanoTime() - start);
}
public void overall(long t, long nanoTime) {
// TODO Auto-generated method stub
public void overall(long start) {
overall = overall + (System.nanoTime() - start);
}
public void tx(long t, long nanoTime) {
// TODO Auto-generated method stub
public void tx(long start) {
txTime = txTime + (System.nanoTime() - start);
}
public void sd(long t, long nanoTime) {
// TODO Auto-generated method stub
public void sd(long start) {
sdTime = sdTime + (System.nanoTime() - start);
}
public void fpe(long t, long nanoTime) {
// TODO Auto-generated method stub
fpeTime = fpeTime + (System.nanoTime() - t);
public void fpe(long start) {
fpeTime = fpeTime + (System.nanoTime() - start);
}
public void reset() {
overall = 0;
txTime = 0;

View File

@ -515,7 +515,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
} catch (IOException e1) {
throw new FHIRException(e1);
}
timeTracker.load(t, System.nanoTime());
timeTracker.load(t);
if (e != null)
validate(appContext, errors, e, profiles);
return e;
@ -544,7 +544,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
} catch (IOException e1) {
throw new FHIRException(e1);
}
timeTracker.load(t, System.nanoTime());
timeTracker.load(t);
validate(appContext, errors, e, profiles);
return e;
}
@ -574,7 +574,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
} catch (IOException e1) {
throw new FHIRException(e1);
}
timeTracker.load(t, System.nanoTime());
timeTracker.load(t);
if (e != null)
validate(appContext, errors, e, profiles);
return e;
@ -605,7 +605,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
} catch (IOException e1) {
throw new FHIRException(e1);
}
timeTracker.load(t, System.nanoTime());
timeTracker.load(t);
if (e != null)
validate(appContext, errors, e, profiles);
return e;
@ -631,7 +631,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
parser.setupValidation(ValidationPolicy.EVERYTHING, errors);
long t = System.nanoTime();
Element e = parser.parse(object);
timeTracker.load(t, System.nanoTime());
timeTracker.load(t);
if (e != null)
validate(appContext, errors, e, profiles);
return e;
@ -672,7 +672,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (hintAboutNonMustSupport) {
checkElementUsage(errors, element, new NodeStack(context, element, validationLanguage));
}
timeTracker.overall(t, System.nanoTime());
timeTracker.overall(t);
}
private void checkElementUsage(List<ValidationMessage> errors, Element element, NodeStack stack) {
@ -728,11 +728,11 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
private boolean checkCode(List<ValidationMessage> errors, Element element, String path, String code, String system, String display, boolean checkDisplay, NodeStack stack) throws TerminologyServiceException {
long t = System.nanoTime();
boolean ss = context.supportsSystem(system);
timeTracker.tx(t, System.nanoTime());
timeTracker.tx(t);
if (ss) {
t = System.nanoTime();
ValidationResult s = checkCodeOnServer(stack, code, system, display, checkDisplay);
timeTracker.tx(t, System.nanoTime());
timeTracker.tx(t);
if (s == null)
return true;
if (s.isOk()) {
@ -949,7 +949,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
}
}
}
timeTracker.tx(t, System.nanoTime());
timeTracker.tx(t);
}
}
} catch (Exception e) {
@ -1054,7 +1054,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
}
}
}
timeTracker.tx(t, System.nanoTime());
timeTracker.tx(t);
}
}
} catch (Exception e) {
@ -1098,7 +1098,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (binding.getStrength() != BindingStrength.EXAMPLE) {
vr = checkCodeOnServer(stack, valueset, c, true);
}
timeTracker.tx(t, System.nanoTime());
timeTracker.tx(t);
if (vr != null && !vr.isOk()) {
if (vr.IsNoService())
txHint(errors, vr.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, false, I18nConstants.TERMINOLOGY_TX_BINDING_NOSERVER);
@ -1222,7 +1222,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
try {
long t = System.nanoTime();
ValidationResult vr = checkCodeOnServer(stack, valueset, cc, false);
timeTracker.tx(t, System.nanoTime());
timeTracker.tx(t);
if (!vr.isOk()) {
if (vr.getErrorClass() != null && vr.getErrorClass().isInfrastructure())
txWarning(errors, vr.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, false, I18nConstants.TERMINOLOGY_TX_NOVALID_7, describeReference(maxVSUrl), valueset.getUrl(), vr.getMessage());
@ -1241,7 +1241,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
try {
long t = System.nanoTime();
ValidationResult vr = checkCodeOnServer(stack, valueset, c, true);
timeTracker.tx(t, System.nanoTime());
timeTracker.tx(t);
if (!vr.isOk()) {
if (vr.getErrorClass() != null && vr.getErrorClass().isInfrastructure())
txWarning(errors, vr.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, false, I18nConstants.TERMINOLOGY_TX_NOVALID_9, describeReference(maxVSUrl), valueset.getUrl(), vr.getMessage());
@ -1260,7 +1260,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
try {
long t = System.nanoTime();
ValidationResult vr = checkCodeOnServer(stack, valueset, value, new ValidationOptions(stack.getWorkingLang()));
timeTracker.tx(t, System.nanoTime());
timeTracker.tx(t);
if (!vr.isOk()) {
if (vr.getErrorClass() != null && vr.getErrorClass().isInfrastructure())
txWarning(errors, vr.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, false, I18nConstants.TERMINOLOGY_TX_NOVALID_9, describeReference(maxVSUrl), valueset.getUrl(), vr.getMessage());
@ -1317,7 +1317,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (binding.getStrength() != BindingStrength.EXAMPLE) {
vr = checkCodeOnServer(stack, valueset, c, true);
}
timeTracker.tx(t, System.nanoTime());
timeTracker.tx(t);
if (vr != null && !vr.isOk()) {
if (vr.IsNoService())
txHint(errors, vr.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, false, I18nConstants.TERMINOLOGY_TX_BINDING_NOSERVER);
@ -1387,7 +1387,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
long t = System.nanoTime();
StructureDefinition ex = Utilities.isAbsoluteUrl(url) ? context.fetchResource(StructureDefinition.class, url) : null;
timeTracker.sd(t, System.nanoTime());
timeTracker.sd(t);
if (ex == null) {
if (xverManager == null) {
xverManager = new XVerExtensionManager(context);
@ -2111,7 +2111,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
ValidationOptions options = new ValidationOptions(stack.getWorkingLang()).guessSystem();
vr = checkCodeOnServer(stack, vs, value, options);
}
timeTracker.tx(t, System.nanoTime());
timeTracker.tx(t);
if (vr != null && !vr.isOk()) {
if (vr.IsNoService())
txHint(errors, vr.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, false, I18nConstants.TERMINOLOGY_TX_NOVALID_15, value);
@ -2486,7 +2486,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
else
return null;
} finally {
timeTracker.sd(t, System.nanoTime());
timeTracker.sd(t);
}
}
@ -2628,7 +2628,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
ExpressionNode expr = fpe.parse(fixExpr(discriminator));
long t2 = System.nanoTime();
ed = fpe.evaluateDefinition(expr, profile, element);
timeTracker.sd(t2, System.nanoTime());
timeTracker.sd(t2);
if (ed != null)
elements.add(ed);
@ -2653,7 +2653,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
expr = fpe.parse(fixExpr(discriminator));
t2 = System.nanoTime();
ed = fpe.evaluateDefinition(expr, profile, element);
timeTracker.sd(t2, System.nanoTime());
timeTracker.sd(t2);
if (ed != null)
elements.add(ed);
}
@ -2681,7 +2681,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
url = "http://hl7.org/fhir/StructureDefinition/" + url;
long t = System.nanoTime();
StructureDefinition sd = context.fetchResource(StructureDefinition.class, url);
timeTracker.sd(t, System.nanoTime());
timeTracker.sd(t);
if (sd != null && (sd.getType().equals(type) || sd.getUrl().equals(type)) && sd.hasSnapshot())
return sd;
}
@ -2722,7 +2722,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
try {
return context.fetchCodeSystem(system);
} finally {
timeTracker.tx(t, System.nanoTime());
timeTracker.tx(t);
}
}
@ -2957,7 +2957,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
} else {
long t = System.nanoTime();
StructureDefinition fr = context.fetchResource(StructureDefinition.class, pr);
timeTracker.sd(t, System.nanoTime());
timeTracker.sd(t);
return fr;
}
}
@ -2969,7 +2969,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
url = "http://hl7.org/fhir/StructureDefinition/" + url;
long t = System.nanoTime();
StructureDefinition sd = context.fetchResource(StructureDefinition.class, url);
timeTracker.sd(t, System.nanoTime());
timeTracker.sd(t);
if (sd != null && (sd.getType().equals(type) || sd.getUrl().equals(type)) && sd.hasSnapshot())
return sd.getSnapshot().getElement().get(0);
}
@ -3121,7 +3121,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
} catch (FHIRLexerException e) {
throw new FHIRException(context.formatMessage(I18nConstants.PROBLEM_PROCESSING_EXPRESSION__IN_PROFILE__PATH__, expression, profile.getUrl(), path, e.getMessage()));
}
timeTracker.fpe(t, System.nanoTime());
timeTracker.fpe(t);
ed.setUserData("slice.expression.cache", n);
}
@ -3146,7 +3146,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
try {
long t = System.nanoTime();
ok = fpe.evaluateToBoolean(hostContext.forProfile(profile), hostContext.getResource(), hostContext.getRootResource(), element, n);
timeTracker.fpe(t, System.nanoTime());
timeTracker.fpe(t);
msg = fpe.forLog();
} catch (Exception ex) {
ex.printStackTrace();
@ -3536,7 +3536,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
} else if (isValidResourceType(resourceName, trr)) {
long t = System.nanoTime();
StructureDefinition profile = this.context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/" + resourceName);
timeTracker.sd(t, System.nanoTime());
timeTracker.sd(t);
// special case: resource wrapper is reset if we're crossing a bundle boundary, but not otherwise
ValidatorHostContext hc = null;
if (element.getSpecial() == SpecialElement.BUNDLE_ENTRY || element.getSpecial() == SpecialElement.BUNDLE_OUTCOME || element.getSpecial() == SpecialElement.PARAMETER) {
@ -4277,7 +4277,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
} catch (FHIRLexerException e) {
throw new FHIRException(context.formatMessage(I18nConstants.PROBLEM_PROCESSING_EXPRESSION__IN_PROFILE__PATH__, inv.getExpression(), profile.getUrl(), path, e.getMessage()));
}
timeTracker.fpe(t, System.nanoTime());
timeTracker.fpe(t);
inv.setUserData("validator.expression.cache", n);
}
@ -4286,7 +4286,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
try {
long t = System.nanoTime();
ok = fpe.evaluateToBoolean(hostContext, resource, hostContext.getRootResource(), element, n);
timeTracker.fpe(t, System.nanoTime());
timeTracker.fpe(t);
msg = fpe.forLog();
} catch (Exception ex) {
ok = false;
@ -4337,7 +4337,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
defn = element.getProperty().getStructure();
if (defn == null)
defn = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/" + resourceName);
timeTracker.sd(t, System.nanoTime());
timeTracker.sd(t);
ok = rule(errors, IssueType.INVALID, element.line(), element.col(), stack.addToLiteralPath(resourceName), defn != null, I18nConstants.VALIDATION_VAL_PROFILE_NODEFINITION, resourceName);
}

View File

@ -191,7 +191,7 @@ public class MeasureValidator extends BaseValidator {
if (hint(errors, IssueType.REQUIRED, element.line(), element.col(), stack.getLiteralPath(), measure != null, I18nConstants.MEASURE_MR_M_NONE)) {
long t = System.nanoTime();
Measure msrc = measure.startsWith("#") ? loadMeasure(element, measure.substring(1)) : context.fetchResource(Measure.class, measure);
timeTracker.sd(t, System.nanoTime());
timeTracker.sd(t);
if (warning(errors, IssueType.REQUIRED, m.line(), m.col(), stack.getLiteralPath(), msrc != null, I18nConstants.MEASURE_MR_M_NOTFOUND, measure)) {
boolean inComplete = !"complete".equals(element.getNamedChildValue("status"));
MeasureContext mc = new MeasureContext(msrc, element);

View File

@ -511,7 +511,7 @@ public class QuestionnaireValidator extends BaseValidator {
long t = System.nanoTime();
ValidationResult res = context.validateCode(new ValidationOptions(stack.getWorkingLang()), c, vs);
timeTracker.tx(t, System.nanoTime());
timeTracker.tx(t);
if (!res.isOk()) {
txRule(errors, res.getTxLink(), IssueType.CODEINVALID, value.line(), value.col(), stack.getLiteralPath(), false, I18nConstants.QUESTIONNAIRE_QR_ITEM_BADOPTION, c.getSystem(), c.getCode());
} else if (res.getSeverity() != null) {

View File

@ -100,6 +100,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
@ParameterizedTest(name = "{index}: id {0}")
@MethodSource("data")
public void test(String name, JsonObject content) throws Exception {
long setup = System.nanoTime();
this.content = content;
System.out.println("---- " + name + " ----------------------------------------------------------------");
System.out.println("** Core: ");
@ -185,6 +186,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
val.setAllowExamples(true);
}
val.setAssumeValidRestReferences(content.has("assumeValidRestReferences") ? content.get("assumeValidRestReferences").getAsBoolean() : false);
System.out.println(String.format("Start Validating (%d to set up)", (System.nanoTime() - setup) / 1000000));
if (name.endsWith(".json"))
val.validate(null, errors, IOUtils.toInputStream(testCaseContent, Charsets.UTF_8), FhirFormat.JSON);
else

View File

@ -17,7 +17,7 @@
<properties>
<hapi_fhir_version>5.0.0</hapi_fhir_version>
<validator_test_case_version>1.1.18</validator_test_case_version>
<validator_test_case_version>1.1.19-SNAPSHOT</validator_test_case_version>
<junit_jupiter_version>5.6.2</junit_jupiter_version>
<maven_surefire_version>3.0.0-M4</maven_surefire_version>
<jacoco_version>0.8.5</jacoco_version>
@ -147,7 +147,9 @@
<target>1.8</target>
<forceJavacCompilerUse>false</forceJavacCompilerUse>
<encoding>UTF-8</encoding>
<fork>false</fork>
<!-- Allows running the compiler in a separate process. If false it uses the built in compiler,
while if true it will use an executable. -->
<fork>true</fork>
<meminitial>512m</meminitial>
<maxmem>4000m</maxmem>
<debug>true</debug>
@ -159,6 +161,9 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven_surefire_version}</version>
<configuration>
<forkCount>1</forkCount>
<reuseForks>true</reuseForks>
<parallel>classes</parallel>
<trimStackTrace>false</trimStackTrace>
<testFailureIgnore>false</testFailureIgnore>
<!-- We need to include the ${argLine} here so the Jacoco test arguments are included in the