Stage 2 summary at 50 accepted trajectories
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
14
tasks_gen/train/G1048/reference/i_truck.ddls.asddls
Normal file
14
tasks_gen/train/G1048/reference/i_truck.ddls.asddls
Normal file
@@ -0,0 +1,14 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Truck with depot'
|
||||
define view entity {{P}}I_TRUCK
|
||||
as select from {{p}}truck as truck
|
||||
inner join {{p}}depot as depot on depot.depot_id = truck.depot_id
|
||||
association [0..1] to {{p}}depot as _Depot on truck.depot_id = _Depot.depot_id
|
||||
{
|
||||
key truck.truck_id as truck_id,
|
||||
truck.depot_id as depot_id,
|
||||
truck.capacity_kg as capacity_kg,
|
||||
truck.truck_type as truck_type,
|
||||
_Depot
|
||||
}
|
||||
where truck.capacity_kg > 0
|
||||
51
tasks_gen/train/G1048/reference/t21_test.clas.abap
Normal file
51
tasks_gen/train/G1048/reference/t21_test.clas.abap
Normal file
@@ -0,0 +1,51 @@
|
||||
CLASS {{p}}t21_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 depot_of_truck FOR TESTING.
|
||||
METHODS zero_capacity_absent FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t21_test IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_TRUCK' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_depot TYPE STANDARD TABLE OF {{p}}depot WITH EMPTY KEY.
|
||||
DATA lt_truck TYPE STANDARD TABLE OF {{p}}truck WITH EMPTY KEY.
|
||||
go_env->clear_doubles( ).
|
||||
lt_depot = VALUE #(
|
||||
( client = sy-mandt depot_id = 'D1' depot_name = 'North Depot' city = 'HAMBURG' )
|
||||
( client = sy-mandt depot_id = 'D2' depot_name = 'South Depot' city = 'MUNICH' ) ).
|
||||
lt_truck = VALUE #(
|
||||
( client = sy-mandt truck_id = 'T1' depot_id = 'D1' capacity_kg = 12000 truck_type = 'BOX' )
|
||||
( client = sy-mandt truck_id = 'T2' depot_id = 'D1' capacity_kg = 7500 truck_type = 'FLAT' )
|
||||
( client = sy-mandt truck_id = 'T3' depot_id = 'D2' capacity_kg = 20000 truck_type = 'BOX' )
|
||||
( client = sy-mandt truck_id = 'T4' depot_id = 'D2' capacity_kg = 0 truck_type = 'BOX' )
|
||||
( client = sy-mandt truck_id = 'T5' depot_id = 'D9' capacity_kg = 5000 truck_type = 'BOX' ) ).
|
||||
go_env->insert_test_data( lt_depot ).
|
||||
go_env->insert_test_data( lt_truck ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD depot_of_truck.
|
||||
SELECT SINGLE t~\_depot-city FROM {{p}}i_truck AS t
|
||||
WHERE t~truck_id = 'T1' INTO @DATA(lv_city).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'HAMBURG' act = lv_city ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD zero_capacity_absent.
|
||||
SELECT SINGLE t~truck_id FROM {{p}}i_truck AS t
|
||||
WHERE t~truck_id = 'T4' INTO @DATA(lv_id).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 4 act = sy-subrc ).
|
||||
cl_abap_unit_assert=>assert_initial( act = lv_id ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user