diff --git a/.abapgit.xml b/.abapgit.xml index 08ef542..62007b1 100644 --- a/.abapgit.xml +++ b/.abapgit.xml @@ -12,7 +12,7 @@ 750 - ZCX_ERROR=>C_VERSION + /APMG/CX_ERROR=>C_VERSION diff --git a/abaplint.json b/abaplint.json index b0618ba..fcea96d 100644 --- a/abaplint.json +++ b/abaplint.json @@ -28,7 +28,12 @@ "align_type_expressions": true, "allowed_object_naming": true, "allowed_object_types": { - "allowed": ["CLAS", "DEVC", "INTF"] + "allowed": [ + "CLAS", + "DEVC", + "INTF", + "NSPC" + ] }, "ambiguous_statement": true, "avoid_use": true, @@ -159,41 +164,41 @@ "no_yoda_conditions": true, "nrob_consistency": true, "object_naming": { - "aqbg": "^ZABAPPM", - "aqqu": "^ZABAPPM", - "aqsg": "^ZABAPPM", - "auth": "^ZABAPPM", - "clas": "^ZC(L|X)\\_ERROR", - "cmod": "^ZABAPPM", - "doma": "^ZABAPPM", - "dtel": "^ZABAPPM", - "enho": "^ZABAPPM", - "enhs": "^ZABAPPM", - "enqu": "^EZABAPPM", - "form": "^ZABAPPM", - "fugr": "^ZABAPPM", - "idoc": "^ZABAPPM", + "aqbg": "^Z", + "aqqu": "^Z", + "aqsg": "^Z", + "auth": "^Z", + "clas": "^/APMG/C(L|X)_ERROR", + "cmod": "^Z", + "doma": "^Z", + "dtel": "^Z", + "enho": "^Z", + "enhs": "^Z", + "enqu": "^EZ", + "form": "^Z", + "fugr": "^Z", + "idoc": "^Z", "ignoreNames": [], "ignorePatterns": [], - "intf": "^ZIF\\_ERROR", - "msag": "^ZABAPPM", + "intf": "^/APMG/IF_ERROR", + "msag": "^Z", "patternKind": "required", - "pinf": "^ZABAPPM", - "prog": "^ZABAPPM", - "sfpf": "^ZABAPPM", - "sfpi": "^ZABAPPM", - "shlp": "^ZABAPPM", - "ssfo": "^ZABAPPM", - "ssst": "^ZABAPPM", - "sucu": "^ZABAPPM", - "suso": "^ZABAPPM", - "sxci": "^ZABAPPM", - "tabl": "^ZABAPPM", - "tran": "^ZABAPPM", - "ttyp": "^ZABAPPM", - "wdya": "^ZABAPPM", - "wdyn": "^ZABAPPM", - "xslt": "^ZABAPPM" + "pinf": "^Z", + "prog": "^Z", + "sfpf": "^Z", + "sfpi": "^Z", + "shlp": "^Z", + "ssfo": "^Z", + "ssst": "^Z", + "sucu": "^Z", + "suso": "^Z", + "sxci": "^Z", + "tabl": "^Z", + "tran": "^Z", + "ttyp": "^Z", + "wdya": "^Z", + "wdyn": "^Z", + "xslt": "^Z" }, "obsolete_statement": true, "omit_parameter_name": true, @@ -262,7 +267,7 @@ "xml_consistency": true }, "syntax": { - "errorNamespace": "^(Z|Y|LCL_|TY_|LIF_)", + "errorNamespace": "^(/APMG/|LCL_|TY_|LIF_)", "globalConstants": [], "globalMacros": [], "version": "v750" diff --git a/src/#apmg#.nspc.xml b/src/#apmg#.nspc.xml new file mode 100644 index 0000000..5ecb4d0 --- /dev/null +++ b/src/#apmg#.nspc.xml @@ -0,0 +1,16 @@ + + + + + + /APMG/ + 41813564412598342476 + + + E + apm + apm.to Inc. + + + + diff --git a/src/zcx_error.clas.abap b/src/#apmg#cx_error.clas.abap similarity index 96% rename from src/zcx_error.clas.abap rename to src/#apmg#cx_error.clas.abap index 0f4df2b..7e11060 100644 --- a/src/zcx_error.clas.abap +++ b/src/#apmg#cx_error.clas.abap @@ -1,4 +1,4 @@ -CLASS zcx_error DEFINITION +CLASS /apmg/cx_error DEFINITION PUBLIC INHERITING FROM cx_static_check CREATE PUBLIC. @@ -46,14 +46,14 @@ CLASS zcx_error DEFINITION "! @parameter text | Text "! @parameter previous | Previous exception "! @parameter longtext | Longtext - "! @raising zcx_error | Exception + "! @raising /apmg/cx_error | Exception CLASS-METHODS raise IMPORTING !text TYPE clike !previous TYPE REF TO cx_root OPTIONAL !longtext TYPE csequence OPTIONAL RAISING - zcx_error. + /apmg/cx_error. "! Raise exception with T100 message "!

@@ -67,7 +67,7 @@ CLASS zcx_error DEFINITION "! @parameter msgv4 | Message variable 4 "! @parameter previous | Previous exception "! @parameter longtext | Longtext - "! @raising zcx_error | Exception + "! @raising /apmg/cx_error | Exception CLASS-METHODS raise_t100 IMPORTING msgid TYPE symsgid DEFAULT sy-msgid @@ -79,18 +79,18 @@ CLASS zcx_error DEFINITION !previous TYPE REF TO cx_root OPTIONAL !longtext TYPE csequence OPTIONAL RAISING - zcx_error. + /apmg/cx_error. "! Raise with text from previous exception "! @parameter previous | Previous exception "! @parameter longtext | Longtext - "! @raising zcx_error | Exception + "! @raising /apmg/cx_error | Exception CLASS-METHODS raise_with_text IMPORTING !previous TYPE REF TO cx_root !longtext TYPE csequence OPTIONAL RAISING - zcx_error. + /apmg/cx_error. METHODS get_source_position REDEFINITION. METHODS if_message~get_longtext REDEFINITION. @@ -110,7 +110,7 @@ ENDCLASS. -CLASS zcx_error IMPLEMENTATION. +CLASS /apmg/cx_error IMPLEMENTATION. METHOD constructor ##ADT_SUPPRESS_GENERATION. @@ -251,7 +251,7 @@ CLASS zcx_error IMPLEMENTATION. attr4 = 'IF_T100_DYN_MSG~MSGV4' ). ENDIF. - RAISE EXCEPTION TYPE zcx_error + RAISE EXCEPTION TYPE /apmg/cx_error EXPORTING textid = t100_key msgv1 = msgv1 diff --git a/src/zcx_error.clas.locals_imp.abap b/src/#apmg#cx_error.clas.locals_imp.abap similarity index 100% rename from src/zcx_error.clas.locals_imp.abap rename to src/#apmg#cx_error.clas.locals_imp.abap diff --git a/src/zcx_error.clas.xml b/src/#apmg#cx_error.clas.xml similarity index 92% rename from src/zcx_error.clas.xml rename to src/#apmg#cx_error.clas.xml index 3b0a4b8..a7a7d00 100644 --- a/src/zcx_error.clas.xml +++ b/src/#apmg#cx_error.clas.xml @@ -3,7 +3,7 @@ - ZCX_ERROR + /APMG/CX_ERROR E General Error 40 diff --git a/src/zcx_error_prev.clas.abap b/src/#apmg#cx_error_prev.clas.abap similarity index 84% rename from src/zcx_error_prev.clas.abap rename to src/#apmg#cx_error_prev.clas.abap index 1f67bbe..1833aa4 100644 --- a/src/zcx_error_prev.clas.abap +++ b/src/#apmg#cx_error_prev.clas.abap @@ -1,6 +1,6 @@ -CLASS zcx_error_prev DEFINITION +CLASS /apmg/cx_error_prev DEFINITION PUBLIC - INHERITING FROM zcx_error_text + INHERITING FROM /apmg/cx_error_text CREATE PUBLIC. ************************************************************************ @@ -22,7 +22,7 @@ ENDCLASS. -CLASS zcx_error_prev IMPLEMENTATION. +CLASS /apmg/cx_error_prev IMPLEMENTATION. METHOD constructor ##ADT_SUPPRESS_GENERATION. diff --git a/src/zcx_error_prev.clas.testclasses.abap b/src/#apmg#cx_error_prev.clas.testclasses.abap similarity index 61% rename from src/zcx_error_prev.clas.testclasses.abap rename to src/#apmg#cx_error_prev.clas.testclasses.abap index bcfbf4b..603846e 100644 --- a/src/zcx_error_prev.clas.testclasses.abap +++ b/src/#apmg#cx_error_prev.clas.testclasses.abap @@ -1,4 +1,4 @@ -CLASS ltcx_error_prev DEFINITION FOR TESTING +CLASS ltcl_error_prev DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL. @@ -7,18 +7,18 @@ CLASS ltcx_error_prev DEFINITION FOR TESTING ENDCLASS. -CLASS ltcx_error_prev IMPLEMENTATION. +CLASS ltcl_error_prev IMPLEMENTATION. METHOD test. TRY. TRY. - DATA(i) = 1 / 0. + DATA(i) = 1 / 0 ##NEEDED. CATCH cx_root INTO DATA(previous). - RAISE EXCEPTION TYPE zcx_error_prev EXPORTING previous = previous. + RAISE EXCEPTION TYPE /apmg/cx_error_prev EXPORTING previous = previous. ENDTRY. cl_abap_unit_assert=>fail( ). - CATCH zcx_error INTO DATA(error). + CATCH /apmg/cx_error INTO DATA(error). cl_abap_unit_assert=>assert_equals( act = error->get_text( ) exp = 'Division by zero' ). diff --git a/src/zcx_error_prev.clas.xml b/src/#apmg#cx_error_prev.clas.xml similarity index 70% rename from src/zcx_error_prev.clas.xml rename to src/#apmg#cx_error_prev.clas.xml index d9ca24b..16fee55 100644 --- a/src/zcx_error_prev.clas.xml +++ b/src/#apmg#cx_error_prev.clas.xml @@ -3,7 +3,7 @@ - ZCX_ERROR_PREV + /APMG/CX_ERROR_PREV E Previous Error 40 @@ -13,13 +13,6 @@ X X - - - CONSTRUCTOR - E - CONSTRUCTOR - - diff --git a/src/zcx_error_t100.clas.abap b/src/#apmg#cx_error_t100.clas.abap similarity index 91% rename from src/zcx_error_t100.clas.abap rename to src/#apmg#cx_error_t100.clas.abap index a5cb81d..a389d46 100644 --- a/src/zcx_error_t100.clas.abap +++ b/src/#apmg#cx_error_t100.clas.abap @@ -1,6 +1,6 @@ -CLASS zcx_error_t100 DEFINITION +CLASS /apmg/cx_error_t100 DEFINITION PUBLIC - INHERITING FROM zcx_error + INHERITING FROM /apmg/cx_error CREATE PUBLIC. ************************************************************************ @@ -28,7 +28,7 @@ ENDCLASS. -CLASS zcx_error_t100 IMPLEMENTATION. +CLASS /apmg/cx_error_t100 IMPLEMENTATION. METHOD constructor ##ADT_SUPPRESS_GENERATION. diff --git a/src/zcx_error_t100.clas.testclasses.abap b/src/#apmg#cx_error_t100.clas.testclasses.abap similarity index 54% rename from src/zcx_error_t100.clas.testclasses.abap rename to src/#apmg#cx_error_t100.clas.testclasses.abap index aa3b9f4..86b9bf6 100644 --- a/src/zcx_error_t100.clas.testclasses.abap +++ b/src/#apmg#cx_error_t100.clas.testclasses.abap @@ -1,4 +1,4 @@ -CLASS ltcx_error_t100 DEFINITION FOR TESTING +CLASS ltcl_error_t100 DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL. @@ -7,17 +7,16 @@ CLASS ltcx_error_t100 DEFINITION FOR TESTING ENDCLASS. -CLASS ltcx_error_t100 IMPLEMENTATION. +CLASS ltcl_error_t100 IMPLEMENTATION. METHOD test. TRY. MESSAGE i000(oo) WITH 'Hello,' 'World!'. - RAISE EXCEPTION TYPE zcx_error_t100. - cl_abap_unit_assert=>fail( ). - CATCH zcx_error INTO DATA(lx_error). + RAISE EXCEPTION TYPE /apmg/cx_error_t100. + CATCH /apmg/cx_error INTO DATA(error). cl_abap_unit_assert=>assert_equals( - act = lx_error->get_text( ) + act = error->get_text( ) exp = 'Hello, World!' ). ENDTRY. diff --git a/src/zcx_error_t100.clas.xml b/src/#apmg#cx_error_t100.clas.xml similarity index 70% rename from src/zcx_error_t100.clas.xml rename to src/#apmg#cx_error_t100.clas.xml index 12aba07..4504c1a 100644 --- a/src/zcx_error_t100.clas.xml +++ b/src/#apmg#cx_error_t100.clas.xml @@ -3,7 +3,7 @@ - ZCX_ERROR_T100 + /APMG/CX_ERROR_T100 E Message Error 40 @@ -13,13 +13,6 @@ X X - - - CONSTRUCTOR - E - CONSTRUCTOR - - diff --git a/src/zcx_error_text.clas.abap b/src/#apmg#cx_error_text.clas.abap similarity index 85% rename from src/zcx_error_text.clas.abap rename to src/#apmg#cx_error_text.clas.abap index 5cb3b6c..745ee37 100644 --- a/src/zcx_error_text.clas.abap +++ b/src/#apmg#cx_error_text.clas.abap @@ -1,6 +1,6 @@ -CLASS zcx_error_text DEFINITION +CLASS /apmg/cx_error_text DEFINITION PUBLIC - INHERITING FROM zcx_error_t100 + INHERITING FROM /apmg/cx_error_t100 CREATE PUBLIC. ************************************************************************ @@ -23,7 +23,7 @@ ENDCLASS. -CLASS zcx_error_text IMPLEMENTATION. +CLASS /apmg/cx_error_text IMPLEMENTATION. METHOD constructor ##ADT_SUPPRESS_GENERATION. diff --git a/src/#apmg#cx_error_text.clas.testclasses.abap b/src/#apmg#cx_error_text.clas.testclasses.abap new file mode 100644 index 0000000..16e27f2 --- /dev/null +++ b/src/#apmg#cx_error_text.clas.testclasses.abap @@ -0,0 +1,24 @@ +CLASS ltcl_error_text DEFINITION FOR TESTING + RISK LEVEL HARMLESS + DURATION SHORT FINAL. + + PRIVATE SECTION. + METHODS test FOR TESTING. + +ENDCLASS. + +CLASS ltcl_error_text IMPLEMENTATION. + + METHOD test. + + TRY. + RAISE EXCEPTION TYPE /apmg/cx_error_text EXPORTING text = 'Test'. + CATCH /apmg/cx_error INTO DATA(error). + cl_abap_unit_assert=>assert_equals( + act = error->get_text( ) + exp = 'Test' ). + ENDTRY. + + ENDMETHOD. + +ENDCLASS. diff --git a/src/zcx_error_text.clas.xml b/src/#apmg#cx_error_text.clas.xml similarity index 70% rename from src/zcx_error_text.clas.xml rename to src/#apmg#cx_error_text.clas.xml index 242b2a3..94a811a 100644 --- a/src/zcx_error_text.clas.xml +++ b/src/#apmg#cx_error_text.clas.xml @@ -3,7 +3,7 @@ - ZCX_ERROR_TEXT + /APMG/CX_ERROR_TEXT E Text Error 40 @@ -13,13 +13,6 @@ X X - - - CONSTRUCTOR - E - CONSTRUCTOR - - diff --git a/src/zcx_error_text.clas.testclasses.abap b/src/zcx_error_text.clas.testclasses.abap deleted file mode 100644 index 35363b5..0000000 --- a/src/zcx_error_text.clas.testclasses.abap +++ /dev/null @@ -1,25 +0,0 @@ -CLASS ltcx_error_text DEFINITION FOR TESTING - RISK LEVEL HARMLESS - DURATION SHORT FINAL. - - PRIVATE SECTION. - METHODS test FOR TESTING. - -ENDCLASS. - -CLASS ltcx_error_text IMPLEMENTATION. - - METHOD test. - - TRY. - RAISE EXCEPTION TYPE zcx_error_text EXPORTING text = 'Test'. - cl_abap_unit_assert=>fail( ). - CATCH zcx_error INTO DATA(lx_error). - cl_abap_unit_assert=>assert_equals( - act = lx_error->get_text( ) - exp = 'Test' ). - ENDTRY. - - ENDMETHOD. - -ENDCLASS.