more working on test suite

This commit is contained in:
Grahame Grieve 2019-08-05 15:48:07 +10:00
parent 1d10470e9c
commit 9d1d64bb59
2 changed files with 38 additions and 0 deletions

View File

@ -30,12 +30,14 @@ import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat;
import org.hl7.fhir.r5.elementmodel.ObjectConverter; import org.hl7.fhir.r5.elementmodel.ObjectConverter;
import org.hl7.fhir.r5.formats.XmlParser; import org.hl7.fhir.r5.formats.XmlParser;
import org.hl7.fhir.r5.model.Base; import org.hl7.fhir.r5.model.Base;
import org.hl7.fhir.r5.model.CodeSystem;
import org.hl7.fhir.r5.model.Constants; import org.hl7.fhir.r5.model.Constants;
import org.hl7.fhir.r5.model.FhirPublication; import org.hl7.fhir.r5.model.FhirPublication;
import org.hl7.fhir.r5.model.Patient; import org.hl7.fhir.r5.model.Patient;
import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.Resource;
import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.TypeDetails; 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.test.utils.TestingUtilities;
import org.hl7.fhir.r5.utils.FHIRPathEngine.IEvaluationContext; import org.hl7.fhir.r5.utils.FHIRPathEngine.IEvaluationContext;
import org.hl7.fhir.r5.utils.IResourceValidator; import org.hl7.fhir.r5.utils.IResourceValidator;
@ -140,6 +142,15 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
if (content.has("questionnaire")) { if (content.has("questionnaire")) {
ve.getContext().cacheResource(loadResource(TestUtilities.resourceNameToFile("validation-examples", content.get("questionnaire").getAsString()), v)); ve.getContext().cacheResource(loadResource(TestUtilities.resourceNameToFile("validation-examples", content.get("questionnaire").getAsString()), v));
} }
if (content.has("codesystems")) {
for (JsonElement je : content.getAsJsonArray("codesystems")) {
String p = je.getAsString();
System.out.println("CodeSystem: " + p);
String filename = TestUtilities.resourceNameToFile("validation-examples", p);
CodeSystem sd = (CodeSystem) loadResource(filename, v);
val.getContext().cacheResource(sd);
}
}
if (content.has("profiles")) { if (content.has("profiles")) {
for (JsonElement je : content.getAsJsonArray("profiles")) { for (JsonElement je : content.getAsJsonArray("profiles")) {
String p = je.getAsString(); String p = je.getAsString();
@ -303,4 +314,9 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
throw new NotImplementedException("Not done yet (IGPublisherHostServices.conformsToProfile), when item is element"); throw new NotImplementedException("Not done yet (IGPublisherHostServices.conformsToProfile), when item is element");
} }
@Override
public ValueSet resolveValueSet(Object appContext, String url) {
return ve.getContext().fetchResource(ValueSet.class, url);
}
} }

22
pom.xml
View File

@ -151,6 +151,28 @@
<configuration> <configuration>
<testFailureIgnore>true</testFailureIgnore> <testFailureIgnore>true</testFailureIgnore>
<includes> <includes>
<!-- R5: SnomedExpressionsTests.class,
GraphQLParserTests.class,
TurtleTests.class,
ProfileUtilitiesTests.class,
ResourceRoundTripTests.class,
GraphQLEngineTests.class,
LiquidEngineTests.class,
FHIRPathTests.class,
NarrativeGeneratorTests.class,
ShexGeneratorTests.class,
BaseDateTimeTypeTest.class,
OpenApiGeneratorTest.class,
SnapShotGenerationTests.class -->
<!-- validator
ValidationTestSuite.class,
ValidationEngineTests.class,
JsonSchemaTests.class,
ProfileComparisonTests.class,
CDAValidationTestCase.class})
-->
</includes> </includes>
<excludes> <excludes>
<exclude>*</exclude> <exclude>*</exclude>