Remove fhir-test-cases from Validator CLI JAR (#1497)

* WIP drop fhir-test-cases from CLI jar

* Fix missing JUnit4 tests, update to JUnit5 where possible

* Fix unused import

* Include hamcrest dependency

* Fix breaking ValidationEngineTests

* Give kinder error message for missing param
This commit is contained in:
dotasek 2023-11-29 14:48:18 -05:00 committed by GitHub
parent 37a8373b94
commit 698849b9f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 21 deletions

View File

@ -1,6 +1,8 @@
package org.hl7.fhir.utilities;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.nio.file.Files;

View File

@ -76,14 +76,6 @@
option need to be included here.
-->
<dependency>
<groupId>org.hl7.fhir.testcases</groupId>
<artifactId>fhir-test-cases</artifactId>
<version>${validator_test_case_version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.utilities</artifactId>
@ -220,14 +212,6 @@
<scope>compile</scope>
</dependency>
<!--
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
<version>3.1.2.RELEASE</version>
<scope>compile</scope>
</dependency>-->
<dependency>
<groupId>org.everit.json</groupId>
<artifactId>org.everit.json.schema</artifactId>
@ -264,6 +248,20 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>${hamcrest_version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>${hamcrest_version}</version>
<scope>compile</scope>
</dependency>
<!-- /org.hl7.fhir.core test-jar dependencies -->
<!--
@ -271,6 +269,7 @@
org.hl7.fhir.utilities (and others) but are required for the CLI to work,
so we explicitly bring them in here.
-->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>

View File

@ -40,6 +40,11 @@ public class TestsTask extends StandaloneTask{
final String testModuleParam = Params.getParam(args, Params.TEST_MODULES);
final String testClassnameFilter = Params.getParam(args, Params.TEST_NAME_FILTER);
final String testCasesDirectory = Params.getParam(args, Params.TEST);
if (testCasesDirectory == null) {
System.out.println("No fhir-test-cases directory provided. Required usage: -tests <fhir-test-cases-directory>");
System.exit(1);
}
final String txCacheDirectory = Params.getParam(args, Params.TERMINOLOGY_CACHE);
assert TestExecutorParams.isValidModuleParam(testModuleParam) : "Invalid test module param: " + testModuleParam;
final String[] moduleNamesArg = TestExecutorParams.parseModuleParam(testModuleParam);

View File

@ -17,5 +17,9 @@ public class TestModules {
VALIDATION_MODULE
};
public static final List<String> JUNIT4_CLASSNAMES = Arrays.asList("org.hl7.fhir.validation.tests.ValidationTests", "org.hl7.fhir.terminologies.tests.TerminologyServiceTests");
public static final List<String> JUNIT4_CLASSNAMES = Arrays.asList(
"org.hl7.fhir.terminology.tests.LocalTerminologyServiceTests",
"org.hl7.fhir.validation.tests.ValidationTests",
"org.hl7.fhir.terminology.tests.ExternalTerminologyServiceTests",
"org.hl7.fhir.terminology.tests.TerminologyServiceTests");
}

View File

@ -4,7 +4,9 @@ import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.terminologies.client.ITerminologyClient;
import org.hl7.fhir.utilities.VersionUtil;
import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import java.net.URISyntaxException;

View File

@ -21,8 +21,8 @@ import org.junit.jupiter.api.Test;
public class ValidationEngineTests {
// private static final String DEF_TX = FhirSettings.getTxFhirDevelopment();
private static final String DEF_TX = FhirSettings.getTxFhirLocal();
private static final String DEF_TX = FhirSettings.getTxFhirDevelopment();
//private static final String DEF_TX = FhirSettings.getTxFhirLocal();
public static boolean inbuild;