Merge pull request #26 from lmckenzi/Snapshot-Test-error-handling
Snapshot test error handling
This commit is contained in:
commit
607817f4ce
|
@ -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>();
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue