Object type mix: INTF, TABL, STRU, MSAG, exception tasks (harness G2, mutants, generator notes), balanced generator, kind-deficit job order, dashboard mix card
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
26
tasks_gen/train/G1902/reference/cx_booking.clas.abap
Normal file
26
tasks_gen/train/G1902/reference/cx_booking.clas.abap
Normal file
@@ -0,0 +1,26 @@
|
||||
CLASS {{p}}cx_booking DEFINITION PUBLIC INHERITING FROM cx_static_check FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
METHODS constructor
|
||||
IMPORTING iv_msgno TYPE symsgno
|
||||
iv_arg1 TYPE string DEFAULT ''
|
||||
iv_arg2 TYPE string DEFAULT ''.
|
||||
METHODS if_message~get_text REDEFINITION.
|
||||
PRIVATE SECTION.
|
||||
DATA mv_msgno TYPE symsgno.
|
||||
DATA mv_arg1 TYPE string.
|
||||
DATA mv_arg2 TYPE string.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}cx_booking IMPLEMENTATION.
|
||||
METHOD constructor.
|
||||
super->constructor( ).
|
||||
mv_msgno = iv_msgno.
|
||||
mv_arg1 = iv_arg1.
|
||||
mv_arg2 = iv_arg2.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD if_message~get_text.
|
||||
MESSAGE ID '{{P}}MSG' TYPE 'E' NUMBER mv_msgno WITH mv_arg1 mv_arg2 INTO result.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
73
tasks_gen/train/G1902/reference/t41_test.clas.abap
Normal file
73
tasks_gen/train/G1902/reference/t41_test.clas.abap
Normal file
@@ -0,0 +1,73 @@
|
||||
CLASS {{p}}t41_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS msg_001 FOR TESTING.
|
||||
METHODS msg_002 FOR TESTING.
|
||||
METHODS msg_003 FOR TESTING.
|
||||
METHODS msg_004 FOR TESTING.
|
||||
METHODS msg_005 FOR TESTING.
|
||||
METHODS exception_two_args FOR TESTING.
|
||||
METHODS exception_one_arg FOR TESTING.
|
||||
METHODS exception_is_static_check FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t41_test IMPLEMENTATION.
|
||||
METHOD msg_001.
|
||||
DATA lv_text TYPE string.
|
||||
MESSAGE ID '{{P}}MSG' TYPE 'E' NUMBER '001' WITH 'ABAP101' INTO lv_text.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'Course ABAP101 is fully booked' act = lv_text ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD msg_002.
|
||||
DATA lv_text TYPE string.
|
||||
MESSAGE ID '{{P}}MSG' TYPE 'E' NUMBER '002' WITH 'P-100' 'ABAP101' INTO lv_text.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = 'Participant P-100 is already booked for course ABAP101'
|
||||
act = lv_text ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD msg_003.
|
||||
DATA lv_text TYPE string.
|
||||
MESSAGE ID '{{P}}MSG' TYPE 'E' NUMBER '003' WITH 'ABAP101' '3' INTO lv_text.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = 'Course ABAP101 has only 3 free seats left'
|
||||
act = lv_text ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD msg_004.
|
||||
DATA lv_text TYPE string.
|
||||
MESSAGE ID '{{P}}MSG' TYPE 'E' NUMBER '004' WITH 'ABAP101' INTO lv_text.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = 'Booking for course ABAP101 is confirmed'
|
||||
act = lv_text ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD msg_005.
|
||||
DATA lv_text TYPE string.
|
||||
MESSAGE ID '{{P}}MSG' TYPE 'E' NUMBER '005' WITH 'ABAP101' '20250301' INTO lv_text.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = 'Course ABAP101 was cancelled on 20250301'
|
||||
act = lv_text ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD exception_two_args.
|
||||
DATA(lo_cx) = NEW {{p}}cx_booking( iv_msgno = '002' iv_arg1 = 'P-100' iv_arg2 = 'ABAP101' ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = 'Participant P-100 is already booked for course ABAP101'
|
||||
act = lo_cx->get_text( ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD exception_one_arg.
|
||||
DATA(lo_cx) = NEW {{p}}cx_booking( iv_msgno = '004' iv_arg1 = 'ABAP101' ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = 'Booking for course ABAP101 is confirmed'
|
||||
act = lo_cx->get_text( ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD exception_is_static_check.
|
||||
DATA lo_cx TYPE REF TO cx_static_check.
|
||||
lo_cx = NEW {{p}}cx_booking( iv_msgno = '001' iv_arg1 = 'ABAP101' ).
|
||||
cl_abap_unit_assert=>assert_bound( lo_cx ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user