From 2bb46f204688d55ec25dc5c2d6f91ee13fa85a0f Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 9 Sep 2020 07:04:08 +1000 Subject: [PATCH] Add failing test to test build --- .../fhir/validation/tests/ValidationTestSuite.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTestSuite.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTestSuite.java index 84bb07d8e..2f9e1ca9a 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTestSuite.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTestSuite.java @@ -224,7 +224,7 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour else val.validate(null, errors, IOUtils.toInputStream(testCaseContent, Charsets.UTF_8), FhirFormat.XML); System.out.println(val.reportTimes()); - checkOutcomes(errors, content, null); + checkOutcomes(errors, content, null, name); } if (content.has("profile")) { System.out.print("** Profile: "); @@ -256,7 +256,7 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour else val.validate(null, errorsProfile, IOUtils.toInputStream(testCaseContent, Charsets.UTF_8), FhirFormat.XML, asSdList(sd)); System.out.println(val.reportTimes()); - checkOutcomes(errorsProfile, profile, filename); + checkOutcomes(errorsProfile, profile, filename, name); } if (content.has("logical")) { JsonObject logical = content.getAsJsonObject("logical"); @@ -280,7 +280,7 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour Assert.assertTrue(fp.evaluateToBoolean(null, le, le, le, fp.parse(exp))); } } - checkOutcomes(errorsLogical, logical, "logical"); + checkOutcomes(errorsLogical, logical, "logical", name); } } @@ -342,7 +342,7 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour } } - private void checkOutcomes(List errors, JsonObject focus, String profile) { + private void checkOutcomes(List errors, JsonObject focus, String profile, String name) { JsonObject java = focus.getAsJsonObject("java"); int ec = 0; int wc = 0; @@ -371,6 +371,9 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour } if (!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 (name.equals("icd-9-condition.xml")) { + Assert.assertEquals("Test " + name + (profile == null ? "" : " profile: "+ profile) + ": Expected " + Integer.toString(1) + " errors, but found " + Integer.toString(ec) + ".", 1, 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); }