Refactor to get consistent ValidationEngine with txCache in tests

This commit is contained in:
dotasek 2021-12-08 12:33:55 -05:00
parent 1c1e7d22ca
commit e5976307f4
6 changed files with 125 additions and 41 deletions

View File

@ -904,7 +904,8 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
if (res != null) {
return res;
}
//FIXME
System.out.print("");
if (options.isUseClient()) {
// ok, first we try to validate locally
try {

View File

@ -0,0 +1,50 @@
package org.hl7.fhir.utilities;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
/**
* An {@link Interceptor} for {@link okhttp3.OkHttpClient} that controls the number of times we retry a to execute a
* given request, before reporting a failure. This includes unsuccessful return codes and timeouts.
*/
public class TxInterceptor implements Interceptor {
private String getKey(String method, String url) {
return method + " " + url;
}
private static TxInterceptor instance;
public static TxInterceptor getInstance() {
if (instance == null) {
instance = new TxInterceptor();
}
return instance;
}
final Set<String> queriedUrls;
private TxInterceptor() {
queriedUrls = new HashSet<>();
}
@Override
public Response intercept(Interceptor.Chain chain) throws IOException {
Response response = chain.proceed(chain.request());
final String key = getKey(response.request().method(), response.request().url().toString());
if (!queriedUrls.contains(key)) {
queriedUrls.add(key);
System.out.print("");
}
return response;
}
}

View File

@ -0,0 +1,5 @@
package org.hl7.fhir;
public class TestConstants {
public static final java.lang.String TX_CACHE = "/Users/david.otasek/org.hl7.fhir.core-cache";
}

View File

@ -0,0 +1,20 @@
package org.hl7.fhir;
import org.hl7.fhir.r5.model.FhirPublication;
import org.hl7.fhir.validation.ValidationEngine;
public class TestingUtilities {
public static final ValidationEngine getValidationEngine(java.lang.String src, java.lang.String txsrvr, java.lang.String txLog, FhirPublication version, boolean canRunWithoutTerminologyServer, java.lang.String vString, java.lang.String userAgent) throws Exception {
final ValidationEngine validationEngine = new ValidationEngine(src, txsrvr, txLog, version, canRunWithoutTerminologyServer, vString, userAgent);
validationEngine.getContext().initTS(TestConstants.TX_CACHE);
validationEngine.getContext().setUserAgent("fhir/test-cases");
return validationEngine;
}
public static ValidationEngine getValidationEngine(java.lang.String src, java.lang.String txsrvr, java.lang.String txLog, FhirPublication version, java.lang.String vString, java.lang.String userAgent) throws Exception {
final ValidationEngine validationEngine = new ValidationEngine(src, txsrvr, txLog, version, vString, userAgent);
validationEngine.getContext().initTS(TestConstants.TX_CACHE);
validationEngine.getContext().setUserAgent("fhir/test-cases");
return validationEngine;
}
}

View File

@ -3,6 +3,7 @@ package org.hl7.fhir.validation.tests;
import java.util.ArrayList;
import java.util.List;
import org.hl7.fhir.TestConstants;
import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat;
import org.hl7.fhir.r5.model.FhirPublication;
import org.hl7.fhir.r5.model.OperationOutcome;
@ -26,7 +27,8 @@ public class ValidationEngineTests {
public void testCurrentXml() throws Exception {
if (!TestUtilities.silent)
System.out.println("TestCurrentXml: Validate patient-example.xml in Current version");
ValidationEngine ve = new ValidationEngine("hl7.fhir.r4.core#4.0.1", DEF_TX, null, FhirPublication.R4, "4.0.1", "fhir/test-cases");
ValidationEngine ve = org.hl7.fhir.TestingUtilities.getValidationEngine("hl7.fhir.r4.core#4.0.1", DEF_TX, null, FhirPublication.R4, "4.0.1", "fhir/test-cases");
OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "patient-example.xml"), null);
int e = errors(op);
int w = warnings(op);
@ -46,7 +48,8 @@ public class ValidationEngineTests {
public void testCurrentJson() throws Exception {
if (!TestUtilities.silent)
System.out.println("TestCurrentJson: Validate patient-example.json in Current version");
ValidationEngine ve = new ValidationEngine("hl7.fhir.r4.core#4.0.1", DEF_TX, null, FhirPublication.R4, "4.0.1", "fhir/test-cases");
ValidationEngine ve = org.hl7.fhir.TestingUtilities.getValidationEngine("hl7.fhir.r4.core#4.0.1", DEF_TX, null, FhirPublication.R4, "4.0.1", "fhir/test-cases");
OperationOutcome op = ve.validate(FhirFormat.JSON, TestingUtilities.loadTestResourceStream("validator", "patient-example.json"), null);
int e = errors(op);
int w = warnings(op);
@ -66,7 +69,8 @@ public class ValidationEngineTests {
}
if (!TestUtilities.silent)
System.out.println("Test140: Validate patient-example.xml in v1.4.0 version");
ValidationEngine ve = new ValidationEngine("hl7.fhir.r2b.core#1.4.0", DEF_TX, null, FhirPublication.DSTU2016May, "1.4.0", "fhir/test-cases");
ValidationEngine ve = org.hl7.fhir.TestingUtilities.getValidationEngine("hl7.fhir.r2b.core#1.4.0", DEF_TX, null, FhirPublication.DSTU2016May, "1.4.0", "fhir/test-cases");
ve.getContext().initTS(TestConstants.TX_CACHE);
ve.getContext().setUserAgent("fhir/test-cases");
OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "patient140.xml"), null);
if (!TestUtilities.silent)
@ -91,7 +95,8 @@ public class ValidationEngineTests {
}
if (!org.hl7.fhir.validation.tests.utilities.TestUtilities.silent)
System.out.println("Test102: Validate patient-example.xml in v1.0.2 version");
ValidationEngine ve = new ValidationEngine("hl7.fhir.r2.core#1.0.2", DEF_TX, null, FhirPublication.DSTU2, "1.0.2", "fhir/test-cases");
ValidationEngine ve = org.hl7.fhir.TestingUtilities.getValidationEngine("hl7.fhir.r2.core#1.0.2", DEF_TX, null, FhirPublication.DSTU2, "1.0.2", "fhir/test-cases");
ve.setNoInvariantChecks(true);
OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "patient102.xml"), null);
if (!TestUtilities.silent)
@ -116,7 +121,8 @@ public class ValidationEngineTests {
}
if (!TestUtilities.silent)
System.out.println("TestObs102: Validate patient-example.xml in v1.0.2 version");
ValidationEngine ve = new ValidationEngine("hl7.fhir.r2.core#1.0.2", DEF_TX, null, FhirPublication.DSTU2, "1.0.2", "fhir/test-cases");
ValidationEngine ve = org.hl7.fhir.TestingUtilities.getValidationEngine("hl7.fhir.r2.core#1.0.2", DEF_TX, null, FhirPublication.DSTU2, "1.0.2", "fhir/test-cases");
ve.setNoInvariantChecks(true);
OperationOutcome op = ve.validate(FhirFormat.JSON, TestingUtilities.loadTestResourceStream("validator", "observation102.json"), null);
if (!TestUtilities.silent)
@ -138,7 +144,8 @@ public class ValidationEngineTests {
public void test301() throws Exception {
if (!TestUtilities.silent)
System.out.println("Test301: Validate observation301.xml against Core");
ValidationEngine ve = new ValidationEngine("hl7.fhir.r3.core#3.0.2", DEF_TX, null, FhirPublication.STU3, "3.0.2", "fhir/test-cases");
ValidationEngine ve = org.hl7.fhir.TestingUtilities.getValidationEngine("hl7.fhir.r3.core#3.0.2", DEF_TX, null, FhirPublication.STU3, "3.0.2", "fhir/test-cases");
if (!TestUtilities.silent)
System.out.println(" .. load USCore");
OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "observation301.xml"), null);
@ -157,7 +164,8 @@ public class ValidationEngineTests {
public void test301USCore() throws Exception {
if (!TestUtilities.silent)
System.out.println("Test301USCore: Validate patient300.xml against US-Core");
ValidationEngine ve = new ValidationEngine("hl7.fhir.r3.core#3.0.2", DEF_TX, null, FhirPublication.STU3, "3.0.2", "fhir/test-cases");
ValidationEngine ve = org.hl7.fhir.TestingUtilities.getValidationEngine("hl7.fhir.r3.core#3.0.2", DEF_TX, null, FhirPublication.STU3, "3.0.2", "fhir/test-cases");
IgLoader igLoader = new IgLoader(ve.getPcm(), ve.getContext(), ve.getVersion(), true);
if (!TestUtilities.silent)
System.out.println(" .. load USCore");

View File

@ -15,6 +15,7 @@ import java.util.Map;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.NotImplementedException;
import org.hl7.fhir.TestingUtilities;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_10_50;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_14_50;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_30_50;
@ -41,7 +42,6 @@ import org.hl7.fhir.r5.model.Resource;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.TypeDetails;
import org.hl7.fhir.r5.model.ValueSet;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.utils.FHIRPathEngine;
import org.hl7.fhir.r5.utils.FHIRPathEngine.IEvaluationContext;
import org.hl7.fhir.r5.utils.validation.IResourceValidator;
@ -86,7 +86,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
@Parameters(name = "{index}: id {0}")
public static Iterable<Object[]> data() throws IOException {
String contents = TestingUtilities.loadTestResource("validator", "manifest.json");
String contents = org.hl7.fhir.r5.test.utils.TestingUtilities.loadTestResource("validator", "manifest.json");
Map<String, JsonObject> examples = new HashMap<String, JsonObject>();
manifest = (JsonObject) new com.google.gson.JsonParser().parse(contents);
@ -120,6 +120,8 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
this.content = content;
}
@SuppressWarnings("deprecation")
@Test
public void test() throws Exception {
@ -141,31 +143,29 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
version = VersionUtilities.getMajMin(version);
if (!ve.containsKey(version)) {
if (version.startsWith("5.0"))
ve.put(version, new ValidationEngine("hl7.fhir.r5.core#4.5.0", ValidationEngineTests.DEF_TX, txLog, FhirPublication.R5, true, "4.5.0", "fhir/test-cases"));
ve.put(version, TestingUtilities.getValidationEngine("hl7.fhir.r5.core#4.5.0", ValidationEngineTests.DEF_TX, txLog, FhirPublication.R5, true, "4.5.0", "fhir/test-cases"));
else if (version.startsWith("3.0"))
ve.put(version, new ValidationEngine("hl7.fhir.r3.core#3.0.2", ValidationEngineTests.DEF_TX, txLog, FhirPublication.STU3, true, "3.0.2", "fhir/test-cases"));
ve.put(version, TestingUtilities.getValidationEngine("hl7.fhir.r3.core#3.0.2", ValidationEngineTests.DEF_TX, txLog, FhirPublication.STU3, true, "3.0.2", "fhir/test-cases"));
else if (version.startsWith("4.0"))
ve.put(version, new ValidationEngine("hl7.fhir.r4.core#4.0.1", ValidationEngineTests.DEF_TX, txLog, FhirPublication.R4, true, "4.0.1", "fhir/test-cases"));
ve.put(version, TestingUtilities.getValidationEngine("hl7.fhir.r4.core#4.0.1", ValidationEngineTests.DEF_TX, txLog, FhirPublication.R4, true, "4.0.1", "fhir/test-cases"));
else if (version.startsWith("1.0"))
ve.put(version, new ValidationEngine("hl7.fhir.r2.core#1.0.2", ValidationEngineTests.DEF_TX, txLog, FhirPublication.DSTU2, true, "1.0.2", "fhir/test-cases"));
ve.put(version, TestingUtilities.getValidationEngine("hl7.fhir.r2.core#1.0.2", ValidationEngineTests.DEF_TX, txLog, FhirPublication.DSTU2, true, "1.0.2", "fhir/test-cases"));
else if (version.startsWith("1.4"))
ve.put(version, new ValidationEngine("hl7.fhir.r2b.core#1.4.0", ValidationEngineTests.DEF_TX, txLog, FhirPublication.DSTU2016May, true, "1.4.0", "fhir/test-cases"));
ve.put(version, TestingUtilities.getValidationEngine("hl7.fhir.r2b.core#1.4.0", ValidationEngineTests.DEF_TX, txLog, FhirPublication.DSTU2016May, true, "1.4.0", "fhir/test-cases"));
else
throw new Exception("unknown version " + version);
}
vCurr = ve.get(version);
vCurr.getContext().setUserAgent("fhir/test-cases");
//vCurr.getContext().initTS("");
igLoader = new IgLoader(vCurr.getPcm(), vCurr.getContext(), vCurr.getVersion(), true);
if (TestingUtilities.fcontexts == null) {
TestingUtilities.fcontexts = new HashMap<>();
if (org.hl7.fhir.r5.test.utils.TestingUtilities.fcontexts == null) {
org.hl7.fhir.r5.test.utils.TestingUtilities.fcontexts = new HashMap<>();
}
TestingUtilities.fcontexts.put(version, vCurr.getContext());
org.hl7.fhir.r5.test.utils.TestingUtilities.fcontexts.put(version, vCurr.getContext());
if (content.has("use-test") && !content.get("use-test").getAsBoolean())
return;
byte[] testCaseContent = TestingUtilities.loadTestResource("validator", JSONUtil.str(content, "file")).getBytes(StandardCharsets.UTF_8);
byte[] testCaseContent = org.hl7.fhir.r5.test.utils.TestingUtilities.loadTestResource("validator", JSONUtil.str(content, "file")).getBytes(StandardCharsets.UTF_8);
// load and process content
FhirFormat fmt = determineFormat(content, testCaseContent);
@ -200,7 +200,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
if (content.has("packages")) {
for (JsonElement e : content.getAsJsonArray("packages")) {
String n = e.getAsString();
InputStream cnt = n.endsWith(".tgz") ? TestingUtilities.loadTestResourceStream("validator", n) : null;
InputStream cnt = n.endsWith(".tgz") ? org.hl7.fhir.r5.test.utils.TestingUtilities.loadTestResourceStream("validator", n) : null;
if (cnt != null) {
igLoader.loadPackage(NpmPackage.fromPackage(cnt));
} else {
@ -214,7 +214,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
if (content.has("supporting")) {
for (JsonElement e : content.getAsJsonArray("supporting")) {
String filename = e.getAsString();
String contents = TestingUtilities.loadTestResource("validator", filename);
String contents = org.hl7.fhir.r5.test.utils.TestingUtilities.loadTestResource("validator", filename);
CanonicalResource mr = (CanonicalResource) loadResource(filename, contents);
val.getContext().cacheResource(mr);
if (mr instanceof ImplementationGuide) {
@ -229,7 +229,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
if (content.has("profiles")) {
for (JsonElement je : content.getAsJsonArray("profiles")) {
String filename = je.getAsString();
String contents = TestingUtilities.loadTestResource("validator", filename);
String contents = org.hl7.fhir.r5.test.utils.TestingUtilities.loadTestResource("validator", filename);
StructureDefinition sd = loadProfile(filename, contents, messages);
val.getContext().cacheResource(sd);
}
@ -273,7 +273,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
if (profile.has("supporting")) {
for (JsonElement e : profile.getAsJsonArray("supporting")) {
String filename = e.getAsString();
String contents = TestingUtilities.loadTestResource("validator", filename);
String contents = org.hl7.fhir.r5.test.utils.TestingUtilities.loadTestResource("validator", filename);
CanonicalResource mr = (CanonicalResource) loadResource(filename, contents);
val.getContext().cacheResource(mr);
if (mr instanceof ImplementationGuide) {
@ -286,7 +286,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
if (Utilities.isAbsoluteUrl(filename)) {
sd = val.getContext().fetchResource(StructureDefinition.class, filename);
} else {
String contents = TestingUtilities.loadTestResource("validator", filename);
String contents = org.hl7.fhir.r5.test.utils.TestingUtilities.loadTestResource("validator", filename);
System.out.println("Name: " + name + " - profile : " + profile.get("source").getAsString());
version = content.has("version") ? content.get("version").getAsString() : Constants.VERSION;
sd = loadProfile(filename, contents, messages);
@ -305,7 +305,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
if (logical.has("supporting")) {
for (JsonElement e : logical.getAsJsonArray("supporting")) {
String filename = e.getAsString();
String contents = TestingUtilities.loadTestResource("validator", filename);
String contents = org.hl7.fhir.r5.test.utils.TestingUtilities.loadTestResource("validator", filename);
CanonicalResource mr = (CanonicalResource) loadResource(filename, contents);
if (mr instanceof StructureDefinition) {
val.getContext().generateSnapshot((StructureDefinition) mr, true);
@ -344,9 +344,9 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
public StructureDefinition loadProfile(String filename, String contents, List<ValidationMessage> messages) throws IOException, FHIRFormatError, FileNotFoundException, FHIRException, DefinitionException {
StructureDefinition sd = (StructureDefinition) loadResource(filename, contents);
ProfileUtilities pu = new ProfileUtilities(TestingUtilities.context(version), messages, null);
ProfileUtilities pu = new ProfileUtilities(org.hl7.fhir.r5.test.utils.TestingUtilities.context(version), messages, null);
if (!sd.hasSnapshot()) {
StructureDefinition base = TestingUtilities.context(version).fetchResource(StructureDefinition.class, sd.getBaseDefinition());
StructureDefinition base = org.hl7.fhir.r5.test.utils.TestingUtilities.context(version).fetchResource(StructureDefinition.class, sd.getBaseDefinition());
pu.generateSnapshot(base, sd, sd.getUrl(), null, sd.getTitle());
// (debugging) new XmlParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path("[tmp]", sd.getId()+".xml")), sd);
}
@ -354,7 +354,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
if (r instanceof StructureDefinition) {
StructureDefinition childSd = (StructureDefinition) r;
if (!childSd.hasSnapshot()) {
StructureDefinition base = TestingUtilities.context(version).fetchResource(StructureDefinition.class, childSd.getBaseDefinition());
StructureDefinition base = org.hl7.fhir.r5.test.utils.TestingUtilities.context(version).fetchResource(StructureDefinition.class, childSd.getBaseDefinition());
pu.generateSnapshot(base, childSd, childSd.getUrl(), null, childSd.getTitle());
}
}
@ -421,7 +421,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
}
}
}
if (!TestingUtilities.context(version).isNoTerminologyServer() || !focus.has("tx-dependent")) {
if (!org.hl7.fhir.r5.test.utils.TestingUtilities.context(version).isNoTerminologyServer() || !focus.has("tx-dependent")) {
Assert.assertEquals("Test " + name + (profile == null ? "" : " profile: "+ profile) + ": Expected " + Integer.toString(java.get("errorCount").getAsInt()) + " errors, but found " + Integer.toString(ec) + ".", java.get("errorCount").getAsInt(), ec);
if (java.has("warningCount")) {
Assert.assertEquals( "Test " + name + (profile == null ? "" : " profile: "+ profile) + ": Expected " + Integer.toString(java.get("warningCount").getAsInt()) + " warnings, but found " + Integer.toString(wc) + ".", java.get("warningCount").getAsInt(), wc);
@ -495,18 +495,18 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
public Element fetch(IResourceValidator validator, Object appContext, String url) throws FHIRFormatError, DefinitionException, IOException, FHIRException {
Element res = null;
if (url.equals("Patient/test")) {
res = new ObjectConverter(TestingUtilities.context(version)).convert(new Patient());
} else if (TestingUtilities.findTestResource("validator", url.replace("/", "-").toLowerCase() + ".json")) {
res = Manager.makeParser(TestingUtilities.context(version), FhirFormat.JSON).parseSingle(TestingUtilities.loadTestResourceStream("validator", url.replace("/", "-").toLowerCase() + ".json"));
} else if (TestingUtilities.findTestResource("validator", url.replace("/", "-").toLowerCase() + ".xml")) {
res = Manager.makeParser(TestingUtilities.context(version), FhirFormat.XML).parseSingle(TestingUtilities.loadTestResourceStream("validator", url.replace("/", "-").toLowerCase() + ".xml"));
res = new ObjectConverter(org.hl7.fhir.r5.test.utils.TestingUtilities.context(version)).convert(new Patient());
} else if (org.hl7.fhir.r5.test.utils.TestingUtilities.findTestResource("validator", url.replace("/", "-").toLowerCase() + ".json")) {
res = Manager.makeParser(org.hl7.fhir.r5.test.utils.TestingUtilities.context(version), FhirFormat.JSON).parseSingle(org.hl7.fhir.r5.test.utils.TestingUtilities.loadTestResourceStream("validator", url.replace("/", "-").toLowerCase() + ".json"));
} else if (org.hl7.fhir.r5.test.utils.TestingUtilities.findTestResource("validator", url.replace("/", "-").toLowerCase() + ".xml")) {
res = Manager.makeParser(org.hl7.fhir.r5.test.utils.TestingUtilities.context(version), FhirFormat.XML).parseSingle(org.hl7.fhir.r5.test.utils.TestingUtilities.loadTestResourceStream("validator", url.replace("/", "-").toLowerCase() + ".xml"));
}
if (res == null && url.contains("/")) {
String tail = url.substring(url.indexOf("/") + 1);
if (TestingUtilities.findTestResource("validator", tail.replace("/", "-").toLowerCase() + ".json")) {
res = Manager.makeParser(TestingUtilities.context(version), FhirFormat.JSON).parseSingle(TestingUtilities.loadTestResourceStream("validator", tail.replace("/", "-").toLowerCase() + ".json"));
} else if (TestingUtilities.findTestResource("validator", tail.replace("/", "-").toLowerCase() + ".xml")) {
res = Manager.makeParser(TestingUtilities.context(version), FhirFormat.XML).parseSingle(TestingUtilities.loadTestResourceStream("validator", tail.replace("/", "-").toLowerCase() + ".xml"));
if (org.hl7.fhir.r5.test.utils.TestingUtilities.findTestResource("validator", tail.replace("/", "-").toLowerCase() + ".json")) {
res = Manager.makeParser(org.hl7.fhir.r5.test.utils.TestingUtilities.context(version), FhirFormat.JSON).parseSingle(org.hl7.fhir.r5.test.utils.TestingUtilities.loadTestResourceStream("validator", tail.replace("/", "-").toLowerCase() + ".json"));
} else if (org.hl7.fhir.r5.test.utils.TestingUtilities.findTestResource("validator", tail.replace("/", "-").toLowerCase() + ".xml")) {
res = Manager.makeParser(org.hl7.fhir.r5.test.utils.TestingUtilities.context(version), FhirFormat.XML).parseSingle(org.hl7.fhir.r5.test.utils.TestingUtilities.loadTestResourceStream("validator", tail.replace("/", "-").toLowerCase() + ".xml"));
}
}
return res;
@ -552,7 +552,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
@Override
public boolean conformsToProfile(Object appContext, Base item, String url) throws FHIRException {
IResourceValidator val = TestingUtilities.context(version).newValidator();
IResourceValidator val = org.hl7.fhir.r5.test.utils.TestingUtilities.context(version).newValidator();
List<ValidationMessage> valerrors = new ArrayList<ValidationMessage>();
if (item instanceof Resource) {
val.validate(appContext, valerrors, (Resource) item, url);