Pipeline controller: plan 2 (hard +, error +50 %), backlog throttle, 2 trajectory workers, stop rules, summaries every 50; budget reserve

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-05 13:35:54 +02:00
parent 1c4667a0fc
commit 13360292dd
781 changed files with 50211 additions and 22 deletions

View File

@@ -0,0 +1,103 @@
CLASS {{p}}tree_test DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS fee_for
IMPORTING
iv_species TYPE string
iv_height_cm TYPE i
iv_near_house TYPE abap_bool
RETURNING
VALUE(rv_fee) TYPE decfloat34.
METHODS species_fees FOR TESTING.
METHODS height_fee FOR TESTING.
METHODS house_fee FOR TESTING.
METHODS tall_tree FOR TESTING.
METHODS invalid_height FOR TESTING.
ENDCLASS.
CLASS {{p}}tree_test IMPLEMENTATION.
METHOD fee_for.
DATA lv_fee TYPE decfloat34.
DATA lv_warning TYPE abap_bool.
CALL FUNCTION '{{P}}TREE_FEE'
EXPORTING
iv_species = iv_species
iv_height_cm = iv_height_cm
iv_near_house = iv_near_house
IMPORTING
ev_fee = lv_fee
ev_warning = lv_warning
EXCEPTIONS
invalid_height = 1
OTHERS = 2.
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
rv_fee = lv_fee.
ENDMETHOD.
METHOD species_fees.
DATA lv_exp TYPE decfloat34.
lv_exp = 200.
cl_abap_unit_assert=>assert_equals(
exp = lv_exp
act = fee_for( iv_species = 'OAK' iv_height_cm = 300 iv_near_house = abap_false ) ).
lv_exp = 120.
cl_abap_unit_assert=>assert_equals(
exp = lv_exp
act = fee_for( iv_species = 'BIRCH' iv_height_cm = 300 iv_near_house = abap_false ) ).
lv_exp = 100.
cl_abap_unit_assert=>assert_equals(
exp = lv_exp
act = fee_for( iv_species = 'ELM' iv_height_cm = 300 iv_near_house = abap_false ) ).
ENDMETHOD.
METHOD height_fee.
DATA lv_exp TYPE decfloat34.
lv_exp = 250.
cl_abap_unit_assert=>assert_equals(
exp = lv_exp
act = fee_for( iv_species = 'OAK' iv_height_cm = 620 iv_near_house = abap_false ) ).
ENDMETHOD.
METHOD house_fee.
DATA lv_exp TYPE decfloat34.
lv_exp = '140.63'.
cl_abap_unit_assert=>assert_equals(
exp = lv_exp
act = fee_for( iv_species = 'ELM' iv_height_cm = 550 iv_near_house = abap_true ) ).
ENDMETHOD.
METHOD tall_tree.
DATA lv_fee TYPE decfloat34.
DATA lv_warning TYPE abap_bool.
DATA lv_exp TYPE decfloat34.
CALL FUNCTION '{{P}}TREE_FEE'
EXPORTING
iv_species = 'OAK'
iv_height_cm = 2500
iv_near_house = abap_false
IMPORTING
ev_fee = lv_fee
ev_warning = lv_warning.
lv_exp = 1200.
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_fee ).
cl_abap_unit_assert=>assert_equals( exp = abap_true act = lv_warning ).
ENDMETHOD.
METHOD invalid_height.
DATA lv_fee TYPE decfloat34.
DATA lv_subrc TYPE sysubrc.
CALL FUNCTION '{{P}}TREE_FEE'
EXPORTING
iv_species = 'OAK'
iv_height_cm = 0
iv_near_house = abap_false
IMPORTING
ev_fee = lv_fee
EXCEPTIONS
invalid_height = 1
OTHERS = 2.
lv_subrc = sy-subrc.
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_subrc ).
ENDMETHOD.
ENDCLASS.