From 64cc3771a6fd68bfa8ce26e41bfcab19d757e83d Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 16 Dec 2022 08:49:14 +1100 Subject: [PATCH] fix tests to get versions consistent --- .../org/hl7/fhir/r5/test/utils/TestingUtilities.java | 6 +++++- .../org/hl7/fhir/r5/test/NarrativeGenerationTests.java | 2 +- .../src/test/java/org/hl7/fhir/r5/test/VocabTests.java | 2 +- .../resources/txCache/org.hl7.fhir.r5/iso4217.cache | 5 +++++ .../resources/txCache/org.hl7.fhir.r5/mimetypes.cache | 5 +++++ .../test/resources/txCache/org.hl7.fhir.r5/ucum.cache | 10 ++++++++++ 6 files changed, 27 insertions(+), 3 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/test/utils/TestingUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/test/utils/TestingUtilities.java index 08b3ead30..b41da88ee 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/test/utils/TestingUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/test/utils/TestingUtilities.java @@ -93,7 +93,10 @@ public class TestingUtilities extends BaseTestingUtilities { * @return */ public static IWorkerContext getSharedWorkerContext(String version) { - + if (!Utilities.existsInList(version, "1.0.2", "3.0.1", "4.0.1", "4.3.0", "5.0.0")) { + throw new Error("illegal version: "+version); + + } String v = VersionUtilities.getMajMin(version); if (fcontexts == null) { @@ -107,6 +110,7 @@ public class TestingUtilities extends BaseTestingUtilities { } public static IWorkerContext getWorkerContext(String version) { + FilesystemPackageCacheManager pcm; try { pcm = new FilesystemPackageCacheManager(true, ToolsVersion.TOOLS_VERSION); diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/NarrativeGenerationTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/NarrativeGenerationTests.java index ea8fe4d26..8e3157705 100644 --- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/NarrativeGenerationTests.java +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/NarrativeGenerationTests.java @@ -178,7 +178,7 @@ public class NarrativeGenerationTests { @BeforeAll public static void setUp() { - context = TestingUtilities.getSharedWorkerContext("5.0.0-ballot"); + context = TestingUtilities.getSharedWorkerContext("5.0.0"); } @ParameterizedTest(name = "{index}: file {0}") diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/VocabTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/VocabTests.java index 5e74e075e..73089fcff 100644 --- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/VocabTests.java +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/VocabTests.java @@ -115,7 +115,7 @@ public class VocabTests { /* Do NOT get a shared worker context from Testing Utilities or else the terminology package loaded below will appear in tests where it causes failures. */ - context = TestingUtilities.getSharedWorkerContext(VersionUtilities.getMajMin(TestingUtilities.DEFAULT_CONTEXT_VERSION)); + context = TestingUtilities.getSharedWorkerContext(TestingUtilities.DEFAULT_CONTEXT_VERSION); } diff --git a/org.hl7.fhir.r5/src/test/resources/txCache/org.hl7.fhir.r5/iso4217.cache b/org.hl7.fhir.r5/src/test/resources/txCache/org.hl7.fhir.r5/iso4217.cache index 7eab6dadc..ca650871d 100644 --- a/org.hl7.fhir.r5/src/test/resources/txCache/org.hl7.fhir.r5/iso4217.cache +++ b/org.hl7.fhir.r5/src/test/resources/txCache/org.hl7.fhir.r5/iso4217.cache @@ -17,3 +17,8 @@ e: { "error" : "Cannot invoke \"org.hl7.fhir.r5.terminologies.TerminologyClient.expandValueset(org.hl7.fhir.r5.model.ValueSet, org.hl7.fhir.r5.model.Parameters, java.util.Map)\" because \"this.txClient\" is null" } ------------------------------------------------------------------------------------- +{"hierarchical" : false, "url": "http://hl7.org/fhir/ValueSet/currencies", "version": "5.0.0-snapshot3"}#### +e: { + "error" : "Cannot invoke \"org.hl7.fhir.r5.terminologies.TerminologyClient.expandValueset(org.hl7.fhir.r5.model.ValueSet, org.hl7.fhir.r5.model.Parameters, java.util.Map)\" because \"this.txClient\" is null" +} +------------------------------------------------------------------------------------- diff --git a/org.hl7.fhir.r5/src/test/resources/txCache/org.hl7.fhir.r5/mimetypes.cache b/org.hl7.fhir.r5/src/test/resources/txCache/org.hl7.fhir.r5/mimetypes.cache index 89832520c..27d6179b3 100644 --- a/org.hl7.fhir.r5/src/test/resources/txCache/org.hl7.fhir.r5/mimetypes.cache +++ b/org.hl7.fhir.r5/src/test/resources/txCache/org.hl7.fhir.r5/mimetypes.cache @@ -17,3 +17,8 @@ e: { "error" : "Cannot invoke \"org.hl7.fhir.r5.terminologies.TerminologyClient.expandValueset(org.hl7.fhir.r5.model.ValueSet, org.hl7.fhir.r5.model.Parameters, java.util.Map)\" because \"this.txClient\" is null" } ------------------------------------------------------------------------------------- +{"hierarchical" : false, "url": "http://hl7.org/fhir/ValueSet/mimetypes", "version": "5.0.0-snapshot3"}#### +e: { + "error" : "Cannot invoke \"org.hl7.fhir.r5.terminologies.TerminologyClient.expandValueset(org.hl7.fhir.r5.model.ValueSet, org.hl7.fhir.r5.model.Parameters, java.util.Map)\" because \"this.txClient\" is null" +} +------------------------------------------------------------------------------------- diff --git a/org.hl7.fhir.r5/src/test/resources/txCache/org.hl7.fhir.r5/ucum.cache b/org.hl7.fhir.r5/src/test/resources/txCache/org.hl7.fhir.r5/ucum.cache index b6d6f4ad2..7b7f6e993 100644 --- a/org.hl7.fhir.r5/src/test/resources/txCache/org.hl7.fhir.r5/ucum.cache +++ b/org.hl7.fhir.r5/src/test/resources/txCache/org.hl7.fhir.r5/ucum.cache @@ -119,3 +119,13 @@ e: { "error" : "Cannot invoke \"org.hl7.fhir.r5.terminologies.TerminologyClient.expandValueset(org.hl7.fhir.r5.model.ValueSet, org.hl7.fhir.r5.model.Parameters, java.util.Map)\" because \"this.txClient\" is null" } ------------------------------------------------------------------------------------- +{"hierarchical" : false, "url": "http://hl7.org/fhir/ValueSet/units-of-time", "version": "5.0.0-snapshot3"}#### +e: { + "error" : "Cannot invoke \"org.hl7.fhir.r5.terminologies.TerminologyClient.expandValueset(org.hl7.fhir.r5.model.ValueSet, org.hl7.fhir.r5.model.Parameters, java.util.Map)\" because \"this.txClient\" is null" +} +------------------------------------------------------------------------------------- +{"hierarchical" : false, "url": "http://hl7.org/fhir/ValueSet/ucum-units", "version": "5.0.0-snapshot3"}#### +e: { + "error" : "Cannot invoke \"org.hl7.fhir.r5.terminologies.TerminologyClient.expandValueset(org.hl7.fhir.r5.model.ValueSet, org.hl7.fhir.r5.model.Parameters, java.util.Map)\" because \"this.txClient\" is null" +} +-------------------------------------------------------------------------------------