mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-07 21:38:15 +00:00
fix hard coded file names
This commit is contained in:
parent
f3b4c81601
commit
89c95c70ca
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user