Package org.fhirfrog.frog.junit
Class TestPackageExecutor
java.lang.Object
org.fhirfrog.frog.junit.TestPackageExecutor
Executes every TestScript (or the single TestPlan closure) discovered in a resolved Test IG
package -
"<id>#<version>", e.g. "fhirfrog.au-core-tests#0.1.0" - reusing
ProgrammaticTestExecutor's existing single-file execution for each discovered file
rather than duplicating TestScriptEngine/TestPlanProvider wiring.
The bundle-discovery logic below (flat-vs-TestPlan detection, *.json listing) ports
frog-runner's own private RunService equivalent (that project's downstream web UI) -
fhir-frog itself never had a shared, reusable version of it. This class is that shared version,
so fhir-frog-cli/-ant/-maven-plugin can each gain Test IG package support without duplicating
this decision three times.
-
Constructor Summary
ConstructorsConstructorDescriptionTestPackageExecutor(org.fhirfrog.frog.internal.testscript.TestPackageResolver testPackageResolver, ProgrammaticTestExecutor executor) Resolver/executor-injecting overload, public specifically so a consumer's own tests can point package resolution at an isolated cache folder instead of the real shared~/.fhir/packages- same rationale asTestPackageResolver's own overload. -
Method Summary
Modifier and TypeMethodDescriptionexecuteTestPackage(String testPackage, String serverUrl, String igPackage, String remoteTerminologyServerUrl)
-
Constructor Details
-
TestPackageExecutor
- Throws:
IOException
-
TestPackageExecutor
public TestPackageExecutor(org.fhirfrog.frog.internal.testscript.TestPackageResolver testPackageResolver, ProgrammaticTestExecutor executor) Resolver/executor-injecting overload, public specifically so a consumer's own tests can point package resolution at an isolated cache folder instead of the real shared~/.fhir/packages- same rationale asTestPackageResolver's own overload.
-
-
Method Details
-
executeTestPackage
public JUnitExecutor.ExecutionResult executeTestPackage(String testPackage, String serverUrl, String igPackage, String remoteTerminologyServerUrl) throws IOException - Parameters:
testPackage-"<id>#<version>"of a Test IG package to resolve and executeserverUrl- FHIR server under testigPackage-"<id>#<version>"to validatevalidateProfileIdassertions against, ornullto skip - only honoured for a flat (multi- TestScript) package; a TestPlan-shaped package's ownProgrammaticTestExecutor.executeTestPlan(java.lang.String, java.lang.String, java.nio.file.Path)has no equivalent parameter yet (an existing asymmetry vs.executeTestScript, not introduced here).remoteTerminologyServerUrl- external FHIR terminology server, ornullto skip - same flat-bundle-only caveat asigPackageabove.- Returns:
- every discovered TestScript's results merged into one
JUnitExecutor.ExecutionResult(successtrue only if every one passed,failures/testResultsconcatenated across all of them) for a flat package, or exactly whatexecuteTestPlanitself returns for a TestPlan one. - Throws:
IllegalArgumentException- if the package contains no TestScript*.jsonfilesIOException- if the package can't be resolved
-