Package org.fhirfrog.frog.testplan
Class TestPlanProvider
java.lang.Object
org.fhirfrog.frog.testplan.TestPlanProvider
JUnit 5 dynamic test provider for recursive TestPlan execution.
Expands test suites lazily with cycle detection and optional PlantUML recording.
Before execution begins, all referenced TestScripts and nested TestPlans are assembled into a local resource map. Unresolvable references are detected and reported before any test executes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classOne test case's result fromexecuteAll(org.fhirfrog.frog.testplan.TestPlanResource, org.fhirfrog.frog.testplan.VariableContext)- the programmatic counterpart to whatgenerateTests(org.fhirfrog.frog.testplan.TestPlanResource, org.fhirfrog.frog.testplan.VariableContext)'s JUnitDynamicTests only report as pass/fail.static classOne test case's static structure fromdiscover(org.fhirfrog.frog.testplan.TestPlanResource)- the same identifying/dependency fields asTestPlanProvider.TestCaseResult, minus the execution-only ones (success,message,testReport) that don't exist until something has actually run. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondiscover(TestPlanResource testPlan) Browses a TestPlan's structure - ids, display names, authored descriptions, dependency edges, and consumed/produced variable names - without executing anything: noTestScriptEngine, no network call, noVariableContextmutation.executeAll(TestPlanResource testPlan, VariableContext context) Programmatic (non-JUnit) counterpart togenerateTests(org.fhirfrog.frog.testplan.TestPlanResource, org.fhirfrog.frog.testplan.VariableContext), for a caller that wants full per-assertion result detail directly rather than JUnitDynamicNodes a JUnit engine executes lazily - e.g. a REST-backed runner likefrog-runner, which reports a realTestReportper test case the same way it already does for flat TestScripts, not just a pass/fail from a discardedassertTrue.executeAll(TestPlanResource testPlan, VariableContext context, Consumer<TestPlanProvider.TestCaseResult> onResult) Same asexecuteAll(TestPlanResource, VariableContext), but invokesonResultthe moment each test case finishes rather than only returning the full list once every case has run - lets a caller (e.g. frog-runner, executing a TestPlan on a background thread) show genuine incremental progress instead of an all-or-nothing jump to 100% once this returns.Stream<org.junit.jupiter.api.DynamicNode>generateTests(TestPlanResource testPlan, VariableContext context)
-
Constructor Details
-
TestPlanProvider
-
-
Method Details
-
generateTests
public Stream<org.junit.jupiter.api.DynamicNode> generateTests(TestPlanResource testPlan, VariableContext context) -
executeAll
public List<TestPlanProvider.TestCaseResult> executeAll(TestPlanResource testPlan, VariableContext context) Programmatic (non-JUnit) counterpart togenerateTests(org.fhirfrog.frog.testplan.TestPlanResource, org.fhirfrog.frog.testplan.VariableContext), for a caller that wants full per-assertion result detail directly rather than JUnitDynamicNodes a JUnit engine executes lazily - e.g. a REST-backed runner likefrog-runner, which reports a realTestReportper test case the same way it already does for flat TestScripts, not just a pass/fail from a discardedassertTrue. Same dependency ordering, cycle detection, and variable threading asgenerateTests(org.fhirfrog.frog.testplan.TestPlanResource, org.fhirfrog.frog.testplan.VariableContext)- suite nesting is flattened into one ordered list (suite-tree-shaped results are a GUI-visualization concern, not yet needed here). -
executeAll
public List<TestPlanProvider.TestCaseResult> executeAll(TestPlanResource testPlan, VariableContext context, Consumer<TestPlanProvider.TestCaseResult> onResult) Same asexecuteAll(TestPlanResource, VariableContext), but invokesonResultthe moment each test case finishes rather than only returning the full list once every case has run - lets a caller (e.g. frog-runner, executing a TestPlan on a background thread) show genuine incremental progress instead of an all-or-nothing jump to 100% once this returns. -
discover
Browses a TestPlan's structure - ids, display names, authored descriptions, dependency edges, and consumed/produced variable names - without executing anything: noTestScriptEngine, no network call, noVariableContextmutation. Lets a caller (e.g. frog-runner's discovery view) show what a TestPlan run *would* do before committing to actually running it. Same dependency-ordering and suite-flattening asexecuteAll(org.fhirfrog.frog.testplan.TestPlanResource, org.fhirfrog.frog.testplan.VariableContext)- the two return cases in the same order, just with execution-only fields (success/message/testReport) absent since nothing ran.
-