remove-JSON-round-trip-guard
hapi-fhir-structures-r4/.../RDFParserTest.java included a guard to NOT
report round-trip errors if JSON didn't round-trip due to changed
ordering of contained resources (and entries in Bundles).
appears to have fixed these issues so the guard is no longer
necessary.
+// hapi-fhir/hapi-fhir-structures-r4$ mvn -Dtest=ca.uhn.fhir.parser.RDFParserTest test
+
package ca.uhn.fhir.parser;
import ca.uhn.fhir.context.FhirContext;
@@ -54,15 +56,6 @@ public class RDFParserTest extends BaseTest {
fhirSchema = GenParser.parseSchema(schemaFile, Collections.emptyList());
}
- // If we can't round-trip JSON, we skip the Turtle round-trip test.
- private static ArrayList<String> jsonRoundTripErrors = new ArrayList<String>();
- @AfterAll
- static void reportJsonRoundTripErrors() {
- System.out.println(jsonRoundTripErrors.size() + " tests disqualified because of JSON round-trip errors");
- for (String e : jsonRoundTripErrors)
- System.out.println(e);
- }
-
/**
* This test method has a method source for each JSON file in the resources/rdf-test-input directory (see #getInputFiles).
* Each input file is expected to be a JSON representation of an R4 FHIR resource.
@@ -86,10 +79,6 @@ public class RDFParserTest extends BaseTest {
String turtleString = serializeRdf(ourCtx, referenceResource);
validateRdf(turtleString, referenceFileName, referenceResource);
- // If we can round-trip JSON
- IBaseResource viaJsonResource = parseJson(new ByteArrayInputStream(referenceJson.getBytes()));
- if (((Base)viaJsonResource).equalsDeep((Base)referenceResource)) {
-
// Parse RDF content as resource
IBaseResource viaTurtleResource = parseRdf(ourCtx, new StringReader(turtleString));
assertNotNull(viaTurtleResource);
@@ -105,16 +94,6 @@ public class RDFParserTest extends BaseTest {
else
assertEquals(referenceJson, viaTurtleJson, failMessage + "\nttl: " + turtleString);
}
- } else {
- String gotString = serializeJson(ourCtx, viaJsonResource);
- String skipMessage = referenceFileName + ": failed to round-trip JSON" +
- (referenceJson.equals(gotString)
- ? "\ngot: " + gotString + "\nexp: " + referenceJson
- : "\nsome inequality not visible in: " + referenceJson);
- System.out.println(referenceFileName + " skipped");
- // Specific messages are printed at end of run.
- jsonRoundTripErrors.add(skipMessage);
- }
}
private static Stream<String> getInputFiles() throws IOException {
