This commit is contained in:
Grahame Grieve 2019-08-06 08:07:02 +10:00
parent c57f578f03
commit 7ef2409bac
1 changed files with 1 additions and 3 deletions

View File

@ -19,13 +19,11 @@ import org.junit.Test;
public class ShexGeneratorTests { public class ShexGeneratorTests {
private void doTest(String name) throws FileNotFoundException, IOException, FHIRException, UcumException { private void doTest(String name) throws FileNotFoundException, IOException, FHIRException, UcumException {
String workingDirectory = "C:\\work\\org.hl7.fhir\\build\\publish"; // FileSystems.getDefault().getPath(System.getProperty("user.dir"), "data").toString();
// String workingDirectory = FileSystems.getDefault().getPath(System.getProperty("user.dir"), "..", "..", "..", "publish").toString();
StructureDefinition sd = TestingUtilities.context().fetchResource(StructureDefinition.class, ProfileUtilities.sdNs(name, null)); StructureDefinition sd = TestingUtilities.context().fetchResource(StructureDefinition.class, ProfileUtilities.sdNs(name, null));
if(sd == null) { if(sd == null) {
throw new FHIRException("StructuredDefinition for " + name + "was null"); throw new FHIRException("StructuredDefinition for " + name + "was null");
} }
Path outPath = FileSystems.getDefault().getPath(workingDirectory, name.toLowerCase()+".shex"); Path outPath = FileSystems.getDefault().getPath(System.getProperty("java.io.tmpdir"), name.toLowerCase()+".shex");
TextFile.stringToFile(new ShExGenerator(TestingUtilities.context()).generate(HTMLLinkPolicy.NONE, sd), outPath.toString()); TextFile.stringToFile(new ShExGenerator(TestingUtilities.context()).generate(HTMLLinkPolicy.NONE, sd), outPath.toString());
} }