From 89c95c70ca6a9970556c7aa29b77d41025c2013f Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Tue, 12 Mar 2019 10:17:30 +1100 Subject: [PATCH] fix hard coded file names --- .../test/java/org/hl7/fhir/r4/test/JsonDirectTests.java | 9 +++++---- .../test/java/org/hl7/fhir/r5/test/JsonDirectTests.java | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/JsonDirectTests.java b/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/JsonDirectTests.java index 8592d4ca3..ea3f7e1c8 100644 --- a/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/JsonDirectTests.java +++ b/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/JsonDirectTests.java @@ -12,6 +12,7 @@ import org.hl7.fhir.r4.formats.IParser.OutputStyle; import org.hl7.fhir.r4.formats.JsonParser; import org.hl7.fhir.r4.formats.XmlParser; import org.hl7.fhir.r4.model.Observation; +import org.hl7.fhir.utilities.Utilities; import org.junit.Before; import org.junit.Test; @@ -23,10 +24,10 @@ public class JsonDirectTests { @Test public void test() throws FHIRFormatError, FileNotFoundException, IOException { - File src = new File("C:\\temp\\obs.xml"); - File xml = new File("C:\\temp\\xml.xml"); - File json = new File("C:\\temp\\json.json"); - File json2 = new File("C:\\temp\\json2.json"); + File src = new File(Utilities.path("[tmp]", "obs.xml")); + File xml = new File(Utilities.path("[tmp]", "xml.xml")); + File json = new File(Utilities.path("[tmp]", "json.json")); + File json2 = new File(Utilities.path("[tmp]", "json2.json")); FileUtils.copyFile(new File("C:\\work\\org.hl7.fhir\\build\\publish\\observation-decimal.xml"), src); Observation obs = (Observation) new XmlParser().parse(new FileInputStream(src)); new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(json), obs); diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/JsonDirectTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/JsonDirectTests.java index 9a173bf92..2a912db46 100644 --- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/JsonDirectTests.java +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/JsonDirectTests.java @@ -12,6 +12,7 @@ import org.hl7.fhir.r5.formats.IParser.OutputStyle; import org.hl7.fhir.r5.formats.JsonParser; import org.hl7.fhir.r5.formats.XmlParser; import org.hl7.fhir.r5.model.Observation; +import org.hl7.fhir.utilities.Utilities; import org.junit.Before; import org.junit.Test; @@ -23,10 +24,10 @@ public class JsonDirectTests { @Test public void test() throws FHIRFormatError, FileNotFoundException, IOException { - File src = new File("C:\\temp\\obs.xml"); - File xml = new File("C:\\temp\\xml.xml"); - File json = new File("C:\\temp\\json.json"); - File json2 = new File("C:\\temp\\json2.json"); + File src = new File(Utilities.path("[tmp]", "obs.xml")); + File xml = new File(Utilities.path("[tmp]", "xml.xml")); + File json = new File(Utilities.path("[tmp]", "json.json")); + File json2 = new File(Utilities.path("[tmp]", "json2.json")); FileUtils.copyFile(new File("C:\\work\\org.hl7.fhir\\build\\publish\\observation-decimal.xml"), src); Observation obs = (Observation) new XmlParser().parse(new FileInputStream(src)); new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(json), obs);