Generator: pilot analysis and fixes; G0002-G0021 tasks; handover notes merged

- Static bundle checks (name length, seed type, reserved words, contract test classes,
  testclasses_file), local abaplint parser check before SAP, max_tokens, robust JSON parse
- Runner: G2 for CDS views with parameters, contract_check detail in report
- G0020 and G0013 fixed by review and revalidated (oracle 100, null 0)
- Pilot results in docs/faz1-tasarim.md 11e; handover notes merged into CLAUDE.md and docs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-03 05:04:23 +02:00
parent 15eb9f1bb2
commit 5de5e2851c
162 changed files with 9943 additions and 23 deletions

View File

@@ -0,0 +1,62 @@
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 revenue_of_one_book FOR TESTING.
METHODS period_is_inclusive FOR TESTING.
ENDCLASS.
CLASS {{p}}t20_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_BOOK_REVENUE' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_book TYPE STANDARD TABLE OF {{p}}book WITH EMPTY KEY.
DATA lt_sale TYPE STANDARD TABLE OF {{p}}sale WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_book = VALUE #(
( book_id = 'A1' title = 'Test Book' category = 'TECH' price = '10.00' ) ).
lt_sale = VALUE #(
( book_id = 'A1' sale_date = '20240101' quantity = 2 )
( book_id = 'A1' sale_date = '20240131' quantity = 3 )
( book_id = 'A1' sale_date = '20240201' quantity = 9 ) ).
go_env->insert_test_data( lt_book ).
go_env->insert_test_data( lt_sale ).
ENDMETHOD.
METHOD revenue_of_one_book.
DATA lv_from TYPE d.
DATA lv_to TYPE d.
lv_from = '20240101'.
lv_to = '20240131'.
SELECT SINGLE sold_quantity, revenue
FROM {{p}}i_book_revenue( p_from = @lv_from, p_to = @lv_to )
WHERE book_id = 'A1'
INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 5 act = CONV i( ls_row-sold_quantity ) ).
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '50.00' )
act = CONV decfloat34( ls_row-revenue ) ).
ENDMETHOD.
METHOD period_is_inclusive.
DATA lv_from TYPE d.
DATA lv_to TYPE d.
lv_from = '20240101'.
lv_to = '20240101'.
SELECT SINGLE sold_quantity
FROM {{p}}i_book_revenue( p_from = @lv_from, p_to = @lv_to )
WHERE book_id = 'A1'
INTO @DATA(lv_sold).
cl_abap_unit_assert=>assert_equals( exp = 2 act = CONV i( lv_sold ) ).
ENDMETHOD.
ENDCLASS.