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,53 @@
CLASS {{p}}t20_test DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
CLASS-DATA go_env TYPE REF TO if_cds_test_environment.
CLASS-METHODS class_setup.
CLASS-METHODS class_teardown.
METHODS setup.
METHODS hold_for_heavy FOR TESTING.
METHODS load_for_light FOR TESTING.
ENDCLASS.
CLASS {{p}}t20_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_CONT_WEIGHT' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_cont TYPE STANDARD TABLE OF {{p}}cont WITH EMPTY KEY.
DATA lt_weigh TYPE STANDARD TABLE OF {{p}}weigh WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_cont = VALUE #( ( cont_id = 'A' customer = 'CUST_A' decl_kg = '1000.00' max_kg = '1100.00' )
( cont_id = 'B' customer = 'CUST_B' decl_kg = '1000.00' max_kg = '1100.00' ) ).
lt_weigh = VALUE #( ( cont_id = 'A' meas_kg = '1150.00' )
( cont_id = 'B' meas_kg = '1010.00' ) ).
go_env->insert_test_data( lt_cont ).
go_env->insert_test_data( lt_weigh ).
ENDMETHOD.
METHOD hold_for_heavy.
SELECT SINGLE deviation_kg, deviation_pct, status FROM {{p}}i_cont_weight
WHERE cont_id = 'A' INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '150.00' )
act = CONV decfloat34( ls_row-deviation_kg ) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '15.00' )
act = CONV decfloat34( ls_row-deviation_pct ) ).
cl_abap_unit_assert=>assert_equals( exp = 'HOLD' act = ls_row-status ).
ENDMETHOD.
METHOD load_for_light.
SELECT SINGLE deviation_kg, deviation_pct, status FROM {{p}}i_cont_weight
WHERE cont_id = 'B' INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '10.00' )
act = CONV decfloat34( ls_row-deviation_kg ) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '1.00' )
act = CONV decfloat34( ls_row-deviation_pct ) ).
cl_abap_unit_assert=>assert_equals( exp = 'LOAD' act = ls_row-status ).
ENDMETHOD.
ENDCLASS.