Merge pull request #26 from lmckenzi/Snapshot-Test-error-handling

Snapshot test error handling
This commit is contained in:
Grahame Grieve 2019-05-20 14:57:07 +10:00 committed by GitHub
commit 607817f4ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -301,6 +301,7 @@ public class SnapShotGenerationTests {
private final TestScriptTestComponent test;
private final String name;
private SnapShotGenerationTestsContext context;
private List<ValidationMessage> messages;
public SnapShotGenerationTests(String name, TestScriptTestComponent e, SnapShotGenerationTestsContext context) {
this.name = name;
@ -312,6 +313,7 @@ public class SnapShotGenerationTests {
@Test
public void test() throws FHIRException {
try {
messages = new ArrayList<ValidationMessage>();
for (Resource cr : context.tests.getContained()) {
if (cr instanceof StructureDefinition) {
StructureDefinition sd = (StructureDefinition) cr;
@ -344,7 +346,7 @@ public class SnapShotGenerationTests {
StructureDefinition source = (StructureDefinition) context.fetchFixture(op.getSourceId());
StructureDefinition base = getSD(source.getBaseDefinition());
StructureDefinition output = source.copy();
ProfileUtilities pu = new ProfileUtilities(TestingUtilities.context(), null, new TestPKP());
ProfileUtilities pu = new ProfileUtilities(TestingUtilities.context(), messages , new TestPKP());
pu.setIds(source, false);
if ("sort=true".equals(op.getParams())) {
List<String> errors = new ArrayList<String>();

View File

@ -817,8 +817,9 @@ public class ValidationEngine {
if (refs.size() > 1)
produceValidationSummary(outcome);
results.addEntry().setResource(outcome);
} catch (Throwable e) {
} catch (Exception e) {
System.out.println("Validation Infrastructure fail validating "+ref+": "+e.getMessage());
throw e;
}
}
if (asBundle)