move test cases

This commit is contained in:
Grahame Grieve 2023-03-08 15:32:52 +11:00
parent 09648b7ea0
commit 0e41463886
3 changed files with 14 additions and 2 deletions

View File

@ -6,3 +6,5 @@
## Other code changes
* rename ig-r4.json to ig-r4.jsonx in IGs
* move R5 package to test cases

View File

@ -114,7 +114,13 @@ public class TestingUtilities extends BaseTestingUtilities {
FilesystemPackageCacheManager pcm;
try {
pcm = new FilesystemPackageCacheManager(true, ToolsVersion.TOOLS_VERSION);
IWorkerContext fcontext = getWorkerContext(pcm.loadPackage(VersionUtilities.packageForVersion(version), version));
IWorkerContext fcontext = null;
if (VersionUtilities.isR5Ver(version)) {
// for purposes of stability, the R5 core package comes from the test case repository
fcontext = getWorkerContext(loadR5CorePackage());
} else {
fcontext = getWorkerContext(pcm.loadPackage(VersionUtilities.packageForVersion(version), version));
}
fcontext.setUcumService(new UcumEssenceService(TestingUtilities.loadTestResourceStream("ucum", "ucum-essence.xml")));
fcontext.setExpansionProfile(new Parameters());
if (!fcontext.hasPackage("hl7.terminology.r5", null)) {
@ -135,6 +141,10 @@ public class TestingUtilities extends BaseTestingUtilities {
}
}
private static NpmPackage loadR5CorePackage() throws IOException {
return NpmPackage.fromPackage(TestingUtilities.loadTestResourceStream("r5", "packages", "hl7.fhir.r5.core.tgz"));
}
public static String getTerminologyCacheDirectory() {
return TestConfig.getInstance().getTxCacheDirectory("org.hl7.fhir.r5");
}

View File

@ -36,7 +36,7 @@ public class ParsingTests {
public static Stream<Arguments> data() throws ParserConfigurationException, IOException, FHIRFormatError, SAXException {
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager(true, ToolsVersion.TOOLS_VERSION);
// npm = pcm.loadPackage("hl7.fhir.r5.examples", "5.0.0");
npm = NpmPackage.fromPackage(TestingUtilities.loadTestResourceStream("r5", "hl7.fhir.r5.examples.tgz"));
npm = NpmPackage.fromPackage(TestingUtilities.loadTestResourceStream("r5", "packages", "hl7.fhir.r5.examples.tgz"));
List<Arguments> objects = new ArrayList<>();
List<String> names = npm.list("package");
for (String n : names) {