Merge pull request #210 from hapifhir/utilities_test_cases
Merging my own pull request. I am become death, the destroyer of worlds.
This commit is contained in:
commit
b604f38983
|
@ -80,6 +80,13 @@
|
||||||
<version>${junit_jupiter_version}</version>
|
<version>${junit_jupiter_version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.hl7.fhir.testcases</groupId>
|
||||||
|
<artifactId>fhir-test-cases</artifactId>
|
||||||
|
<version>${validator_test_case_version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -1,19 +1,27 @@
|
||||||
package org.hl7.fhir.utilities.tests;
|
package org.hl7.fhir.utilities.tests;
|
||||||
|
|
||||||
|
import org.apache.commons.io.IOUtils;
|
||||||
|
import org.hl7.fhir.utilities.TextFile;
|
||||||
|
import org.hl7.fhir.utilities.Utilities;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
import org.hl7.fhir.utilities.TextFile;
|
|
||||||
import org.hl7.fhir.utilities.Utilities;
|
|
||||||
|
|
||||||
public class BaseTestingUtilities {
|
public class BaseTestingUtilities {
|
||||||
|
|
||||||
static public boolean silent;
|
static public boolean silent;
|
||||||
|
|
||||||
public static String loadTestResource(String... paths) throws IOException {
|
public static String loadTestResource(String... paths) throws IOException {
|
||||||
|
/**
|
||||||
|
* This 'if' condition checks to see if the fhir-test-cases project (https://github.com/FHIR/fhir-test-cases) is
|
||||||
|
* installed locally at the same directory level as the core library project is. If so, the test case data is read
|
||||||
|
* directly from that project, instead of the imported maven dependency jar. It is important, that if you want to
|
||||||
|
* test against the dependency imported from sonatype nexus, instead of your local copy, you need to either change
|
||||||
|
* the name of the project directory to something other than 'fhir-test-cases', or move it to another location, not
|
||||||
|
* at the same directory level as the core project.
|
||||||
|
*/
|
||||||
if (new File("../../fhir-test-cases").exists() && isTryToLoadFromFileSystem()) {
|
if (new File("../../fhir-test-cases").exists() && isTryToLoadFromFileSystem()) {
|
||||||
String n = Utilities.path(System.getProperty("user.dir"), "..", "..", "fhir-test-cases", Utilities.path(paths));
|
String n = Utilities.path(System.getProperty("user.dir"), "..", "..", "fhir-test-cases", Utilities.path(paths));
|
||||||
// ok, we'll resolve this locally
|
// ok, we'll resolve this locally
|
||||||
|
|
Loading…
Reference in New Issue