This commit is contained in:
markiantorno 2020-04-29 14:55:47 -04:00
parent 5893249747
commit 1086a46a6c
1 changed files with 20 additions and 32 deletions

View File

@ -1,33 +1,27 @@
package org.hl7.fhir.r5.test.misc;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.ParserConfigurationException;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.exceptions.FHIRFormatError;
import org.hl7.fhir.r5.context.SimpleWorkerContext;
import org.hl7.fhir.r5.model.StructureMap;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.utils.StructureMapUtilities;
import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.Utilities;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import junit.framework.Assert;
import javax.xml.parsers.ParserConfigurationException;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
@RunWith(Parameterized.class)
@Disabled
public class StructureMapTests {
@Parameters(name = "{index}: file {0}")
public static Iterable<Object[]> data() throws ParserConfigurationException, IOException, FHIRFormatError {
public static Stream<Arguments> data() throws ParserConfigurationException, IOException, FHIRFormatError {
List<String> files = new ArrayList<>();
// File dir = new File(Utilities.path(TestingUtilities.home(), "implementations", "r3maps", "R3toR4"));
@ -38,22 +32,16 @@ public class StructureMapTests {
// for (File f : dir.listFiles())
// if (f.getName().endsWith(".map"))
// files.add(f.getAbsolutePath());
List<Object[]> objects = new ArrayList<Object[]>(files.size());
//
List<Arguments> objects = new ArrayList<>();
// for (String fn : files) {
// objects.add(new Object[] { new File(fn).getName(), fn });
// }
return objects;
}
private String filename;
public StructureMapTests(String name, String filename) {
this.filename = filename;
return objects.stream();
}
@SuppressWarnings("deprecation")
@Test
public void test() throws FHIRException, FileNotFoundException, IOException {
@ParameterizedTest
@MethodSource("data")
public void test(String name, String filename) throws FHIRException, FileNotFoundException, IOException {
// if (TestingUtilities.context == null) {
// TestingUtilities.context = SimpleWorkerContext.fromPack(Utilities.path(TestingUtilities.content(), "definitions.xml.zip"));
// }