Stage 2 summary at 50 accepted trajectories
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
44
tasks_gen/train/G1068/generation.json
Normal file
44
tasks_gen/train/G1068/generation.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"id": "G1068",
|
||||
"pool": "train",
|
||||
"object_type": "DDLS",
|
||||
"category": "B",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "bundle",
|
||||
"errors": [
|
||||
"reference/t16_test.clas.abap line 40: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\"",
|
||||
"hidden/t16_hidden.clas.abap line 80: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\"",
|
||||
"hidden/t16_hidden.clas.abap line 86: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\"",
|
||||
"hidden/t16_hidden.clas.abap line 92: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\"",
|
||||
"hidden/t16_hidden.clas.abap line 99: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\""
|
||||
],
|
||||
"by_check": {
|
||||
"abaplint": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 0,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "bundle",
|
||||
"errors": [
|
||||
"reference/t16_test.clas.abap line 44: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\"",
|
||||
"hidden/t16_hidden.clas.abap line 81: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\"",
|
||||
"hidden/t16_hidden.clas.abap line 86: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\"",
|
||||
"hidden/t16_hidden.clas.abap line 97: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\""
|
||||
],
|
||||
"by_check": {
|
||||
"abaplint": 4
|
||||
}
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 0,
|
||||
"null": 0
|
||||
}
|
||||
],
|
||||
"accepted": false
|
||||
}
|
||||
89
tasks_gen/train/G1068/hidden/t16_hidden.clas.abap
Normal file
89
tasks_gen/train/G1068/hidden/t16_hidden.clas.abap
Normal file
@@ -0,0 +1,89 @@
|
||||
CLASS {{p}}t16_hidden 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 stay_rows FOR TESTING.
|
||||
METHODS hotel_rows FOR TESTING.
|
||||
METHODS guest_shown FOR TESTING.
|
||||
METHODS total_price FOR TESTING.
|
||||
METHODS price_decimals FOR TESTING.
|
||||
METHODS town_shown FOR TESTING.
|
||||
METHODS rating_shown FOR TESTING.
|
||||
METHODS unknown_hotel FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t16_hidden IMPLEMENTATION.
|
||||
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_STAY' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_hotel TYPE STANDARD TABLE OF {{p}}hotel WITH EMPTY KEY.
|
||||
DATA lt_stay TYPE STANDARD TABLE OF {{p}}stay WITH EMPTY KEY.
|
||||
|
||||
go_env->clear_doubles( ).
|
||||
|
||||
lt_hotel = VALUE #( ( hotel_id = 'H1' city_name = 'HAMBURG' star_rating = 4 )
|
||||
( hotel_id = 'H2' city_name = 'MUNICH' star_rating = 5 ) ).
|
||||
|
||||
lt_stay = VALUE #( ( stay_id = 'S1' hotel_id = 'H1' guest = 'ADA' nights = 3 price_per_night = '100.00' )
|
||||
( stay_id = 'S2' hotel_id = 'H1' guest = 'BOB' nights = 1 price_per_night = '99.99' )
|
||||
( stay_id = 'S3' hotel_id = 'H2' guest = 'CARA' nights = 2 price_per_night = '10.50' )
|
||||
( stay_id = 'S4' hotel_id = 'H9' guest = 'DAN' nights = 5 price_per_night = '1.00' ) ).
|
||||
|
||||
go_env->insert_test_data( lt_hotel ).
|
||||
go_env->insert_test_data( lt_stay ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD stay_rows.
|
||||
SELECT COUNT(*) FROM {{p}}i_stay INTO @DATA(lv_rows).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 4 act = lv_rows ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD hotel_rows.
|
||||
SELECT COUNT(*) FROM {{p}}i_hotel INTO @DATA(lv_rows).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_rows ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD guest_shown.
|
||||
SELECT SINGLE guest FROM {{p}}i_stay WHERE stay_id = 'S2' INTO @DATA(lv_guest).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'BOB' act = lv_guest ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD total_price.
|
||||
SELECT SINGLE total_price FROM {{p}}i_stay WHERE stay_id = 'S1' INTO @DATA(lv_price).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '300.00' ) act = CONV decfloat34( lv_price ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD price_decimals.
|
||||
SELECT SINGLE total_price FROM {{p}}i_stay WHERE stay_id = 'S3' INTO @DATA(lv_price).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '21.00' ) act = CONV decfloat34( lv_price ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD town_shown.
|
||||
SELECT SINGLE city_name FROM {{p}}i_stay WHERE stay_id = 'S1' INTO @DATA(lv_town).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'HAMBURG' act = lv_town ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rating_shown.
|
||||
SELECT SINGLE star_rating FROM {{p}}i_stay WHERE stay_id = 'S3' INTO @DATA(lv_rating).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV i( 5 ) act = CONV i( lv_rating ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD unknown_hotel.
|
||||
SELECT SINGLE city_name, star_rating FROM {{p}}i_stay WHERE stay_id = 'S4' INTO @DATA(ls_row).
|
||||
cl_abap_unit_assert=>assert_initial( ls_row-city_name ).
|
||||
cl_abap_unit_assert=>assert_initial( ls_row-star_rating ).
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
9
tasks_gen/train/G1068/reference/i_hotel.ddls.asddls
Normal file
9
tasks_gen/train/G1068/reference/i_hotel.ddls.asddls
Normal file
@@ -0,0 +1,9 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Hotel'
|
||||
define view entity {{P}}I_HOTEL
|
||||
as select from {{p}}hotel
|
||||
{
|
||||
key hotel_id as hotel_id,
|
||||
city_name as city_name,
|
||||
star_rating as star_rating
|
||||
}
|
||||
16
tasks_gen/train/G1068/reference/i_stay.ddls.asddls
Normal file
16
tasks_gen/train/G1068/reference/i_stay.ddls.asddls
Normal file
@@ -0,0 +1,16 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Hotel stay'
|
||||
define view entity {{P}}I_STAY
|
||||
as select from {{p}}stay
|
||||
left outer join {{p}}hotel as hotel on hotel.hotel_id = stay.hotel_id
|
||||
association [0..1] to {{P}}I_HOTEL as _Hotel
|
||||
on $projection.hotel_id = _Hotel.hotel_id
|
||||
{
|
||||
key stay.stay_id as stay_id,
|
||||
stay.hotel_id as hotel_id,
|
||||
stay.guest as guest,
|
||||
stay.nights as nights,
|
||||
cast( stay.nights as abap.dec(15,2) ) * stay.price_per_night as total_price,
|
||||
hotel.city_name as city_name,
|
||||
hotel.star_rating as star_rating
|
||||
}
|
||||
42
tasks_gen/train/G1068/reference/t16_test.clas.abap
Normal file
42
tasks_gen/train/G1068/reference/t16_test.clas.abap
Normal file
@@ -0,0 +1,42 @@
|
||||
CLASS {{p}}t16_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 price_and_town FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t16_test IMPLEMENTATION.
|
||||
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_STAY' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_hotel TYPE STANDARD TABLE OF {{p}}hotel WITH EMPTY KEY.
|
||||
DATA lt_stay TYPE STANDARD TABLE OF {{p}}stay WITH EMPTY KEY.
|
||||
|
||||
go_env->clear_doubles( ).
|
||||
|
||||
lt_hotel = VALUE #( ( hotel_id = 'X1' city_name = 'BONN' star_rating = 3 ) ).
|
||||
lt_stay = VALUE #( ( stay_id = 'T1' hotel_id = 'X1' guest = 'EVE' nights = 4 price_per_night = '25.00' ) ).
|
||||
|
||||
go_env->insert_test_data( lt_hotel ).
|
||||
go_env->insert_test_data( lt_stay ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD price_and_town.
|
||||
SELECT SINGLE total_price, city_name FROM {{p}}i_stay WHERE stay_id = 'T1' INTO @DATA(ls_row).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '100.00' ) act = CONV decfloat34( ls_row-total_price ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'BONN' act = ls_row-city_name ).
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
11
tasks_gen/train/G1068/seed/hotel.tabl.asabap
Normal file
11
tasks_gen/train/G1068/seed/hotel.tabl.asabap
Normal file
@@ -0,0 +1,11 @@
|
||||
@EndUserText.label : 'Hotel'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}hotel {
|
||||
key client : abap.clnt not null;
|
||||
key hotel_id : abap.char(10) not null;
|
||||
city_name : abap.char(20);
|
||||
star_rating : abap.int1;
|
||||
}
|
||||
37
tasks_gen/train/G1068/seed/seed_data.clas.abap
Normal file
37
tasks_gen/train/G1068/seed/seed_data.clas.abap
Normal file
@@ -0,0 +1,37 @@
|
||||
CLASS {{p}}seed_data DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
INTERFACES if_oo_adt_classrun.
|
||||
PRIVATE SECTION.
|
||||
METHODS fill_tables.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}seed_data IMPLEMENTATION.
|
||||
|
||||
METHOD if_oo_adt_classrun~main.
|
||||
fill_tables( ).
|
||||
out->write( 'Hotel and stay data written.' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD fill_tables.
|
||||
DATA lt_hotel TYPE STANDARD TABLE OF {{p}}hotel WITH EMPTY KEY.
|
||||
DATA lt_stay TYPE STANDARD TABLE OF {{p}}stay WITH EMPTY KEY.
|
||||
|
||||
lt_hotel = VALUE #(
|
||||
( hotel_id = 'H1' city_name = 'HAMBURG' star_rating = 4 )
|
||||
( hotel_id = 'H2' city_name = 'MUNICH' star_rating = 5 )
|
||||
( hotel_id = 'H3' city_name = 'COLOGNE' star_rating = 3 ) ).
|
||||
|
||||
lt_stay = VALUE #(
|
||||
( stay_id = 'S1' hotel_id = 'H1' guest = 'ADA' nights = 3 price_per_night = '100.00' )
|
||||
( stay_id = 'S2' hotel_id = 'H1' guest = 'BOB' nights = 1 price_per_night = '99.99' )
|
||||
( stay_id = 'S3' hotel_id = 'H2' guest = 'CARA' nights = 2 price_per_night = '10.50' )
|
||||
( stay_id = 'S4' hotel_id = 'H3' guest = 'DAN' nights = 5 price_per_night = '1.00' ) ).
|
||||
|
||||
DELETE FROM {{p}}stay.
|
||||
DELETE FROM {{p}}hotel.
|
||||
INSERT {{p}}hotel FROM TABLE @lt_hotel.
|
||||
INSERT {{p}}stay FROM TABLE @lt_stay.
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
13
tasks_gen/train/G1068/seed/stay.tabl.asabap
Normal file
13
tasks_gen/train/G1068/seed/stay.tabl.asabap
Normal file
@@ -0,0 +1,13 @@
|
||||
@EndUserText.label : 'Hotel stay'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}stay {
|
||||
key client : abap.clnt not null;
|
||||
key stay_id : abap.char(10) not null;
|
||||
hotel_id : abap.char(10);
|
||||
guest : abap.char(20);
|
||||
nights : abap.int4;
|
||||
price_per_night : abap.dec(15,2);
|
||||
}
|
||||
46
tasks_gen/train/G1068/spec.md
Normal file
46
tasks_gen/train/G1068/spec.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# 1. Goal
|
||||
Show each hotel stay together with the data of its hotel. A report and an OData
|
||||
service read the stays. The stay view exposes the association _HOTEL, so that
|
||||
the consumers can read the hotel data of a stay through the association.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Table {{P}}HOTEL (hotel), package $TMP. Key: HOTEL_ID (CHAR 10).
|
||||
Fields: CITY_NAME (CHAR 20), STAR_RATING (INT1).
|
||||
- Table {{P}}STAY (hotel stay), package $TMP. Key: STAY_ID (CHAR 10).
|
||||
Fields: HOTEL_ID (CHAR 10), GUEST (CHAR 20), NIGHTS (INT4),
|
||||
PRICE_PER_NIGHT (DEC 15,2, price for one night).
|
||||
|
||||
# 4. Contract
|
||||
- Create the CDS view entity {{P}}I_HOTEL in package $TMP.
|
||||
Elements, with these names: HOTEL_ID (key), CITY_NAME, STAR_RATING.
|
||||
- Create the CDS view entity {{P}}I_STAY in package $TMP.
|
||||
Elements, with these names: STAY_ID (key), HOTEL_ID, GUEST, NIGHTS,
|
||||
TOTAL_PRICE, CITY_NAME, STAR_RATING.
|
||||
- {{P}}I_STAY has the association _HOTEL. _HOTEL leads to {{P}}I_HOTEL and is
|
||||
part of the interface of {{P}}I_STAY.
|
||||
- No authorization check (#NOT_REQUIRED).
|
||||
|
||||
# 5. Business rules
|
||||
1. {{P}}I_HOTEL shows one row for each row of {{P}}HOTEL.
|
||||
2. {{P}}I_STAY shows one row for each row of {{P}}STAY.
|
||||
3. CITY_NAME and STAR_RATING of a stay are the CITY_NAME and the STAR_RATING
|
||||
of the hotel of the stay.
|
||||
4. TOTAL_PRICE is NIGHTS multiplied by PRICE_PER_NIGHT. TOTAL_PRICE has 2
|
||||
decimals.
|
||||
5. A stay belongs to zero or one hotel. A stay can point to a hotel that is not
|
||||
in {{P}}HOTEL. In this case {{P}}I_STAY still shows the stay, and CITY_NAME
|
||||
and STAR_RATING are empty.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 7.58.
|
||||
- Coding standards: Clean ABAP. Methods have fewer than 40 statements. Pass
|
||||
large parameters by reference.
|
||||
- Out of scope: do not change {{P}}HOTEL and {{P}}STAY.
|
||||
|
||||
# 7. Acceptance
|
||||
- The views are active and have no syntax error.
|
||||
- The hidden tests pass.
|
||||
- Write ABAP Unit tests with CL_CDS_TEST_ENVIRONMENT in a global test class.
|
||||
90
tasks_gen/train/G1068/task.json
Normal file
90
tasks_gen/train/G1068/task.json
Normal file
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"id": "G1068",
|
||||
"category": "B",
|
||||
"object_type": "DDLS",
|
||||
"difficulty": 2,
|
||||
"release_target": "v758",
|
||||
"expected_outcome": "implement",
|
||||
"budget": {
|
||||
"max_tool_calls": 60,
|
||||
"max_activations": 15
|
||||
},
|
||||
"seed": [
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}HOTEL",
|
||||
"file": "seed/hotel.tabl.asabap",
|
||||
"description": "Hotel master data"
|
||||
},
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}STAY",
|
||||
"file": "seed/stay.tabl.asabap",
|
||||
"description": "Hotel stays"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}SEED_DATA",
|
||||
"file": "seed/seed_data.clas.abap",
|
||||
"description": "Seed data for hotel and stay",
|
||||
"run": true
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_HOTEL",
|
||||
"fields": [
|
||||
"HOTEL_ID",
|
||||
"CITY_NAME",
|
||||
"STAR_RATING"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_STAY",
|
||||
"fields": [
|
||||
"STAY_ID",
|
||||
"HOTEL_ID",
|
||||
"GUEST",
|
||||
"NIGHTS",
|
||||
"TOTAL_PRICE",
|
||||
"CITY_NAME",
|
||||
"STAR_RATING"
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}HOTEL",
|
||||
"{{P}}STAY"
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T16_HIDDEN",
|
||||
"file": "hidden/t16_hidden.clas.abap",
|
||||
"description": "T16 hidden tests"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_HOTEL",
|
||||
"file": "reference/i_hotel.ddls.asddls",
|
||||
"description": "Hotel"
|
||||
},
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_STAY",
|
||||
"file": "reference/i_stay.ddls.asddls",
|
||||
"description": "Stay with the association to the hotel"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T16_TEST",
|
||||
"file": "reference/t16_test.clas.abap",
|
||||
"description": "T16 own tests"
|
||||
}
|
||||
],
|
||||
"craft_checks": []
|
||||
}
|
||||
Reference in New Issue
Block a user