larshp / abapOpenChecks

Open source checks for SAP Code Inspector / ABAP Test Cockpit
https://docs.abapopenchecks.org
MIT License
270 stars 79 forks source link

Check 103: Unit test fails when quickfix method doesn't exist #1143

Closed ConjuringCoffee closed 7 months ago

ConjuringCoffee commented 7 months ago

The unit test DATABASE_SELECT_03 for ZCL_AOC_CHECK_103 fails with the following error:

Method call of CREATE_QUICKFIX_ALTERNATIVES failed; the class CL_CI_QUICKFIX_CREATION does not exist

Maybe this ATC check needs to verify if the required methods even exist as a precondition?

I tested this on release 7.50. The class CL_CI_QUICKFIX_CREATION doesn't exist on that release at all.

Tagging the check creator: @fidley

fidley commented 7 months ago

Will check it.

fidley commented 7 months ago

Better validation of the availability of quick fixes needs to be done. The rest of the check should work even without it. I will correct this. Can you share the exception you get? Or dump ;)

ConjuringCoffee commented 7 months ago

Exception Error <DYN_CALL_METH_CLASS_NOT_FOUND>

Analysis

'Method call of CREATE_QUICKFIX_ALTERNATIVES failed; the class CL_CI_QUICKFIX_CREATION does not exist' 
Test 'LTCL_TEST->DATABASE_SELECT_03' in Main Program 'ZCL_AOC_CHECK_103=============CP'. 

Stack

Include: <ZCL_AOC_CHECK_103=============CCIMP> Line: <56> 
Include: <ZCL_AOC_CHECK_103=============CM001> Line: <56> (CHECK) 
Include: <ZCL_AOC_UNIT_TEST=============CM001> Line: <11> (CHECK) 
Include: <ZCL_AOC_CHECK_103=============CCAU> Line: <40> (EXECUTE_CHECK) 
Include: <ZCL_AOC_CHECK_103=============CCAU> Line: <64> (DATABASE_SELECT_03) 
ConjuringCoffee commented 7 months ago

Thanks 🙂

fidley commented 7 months ago

Simple TRY/CATCH block added. This should resolve issue. If not, please reopen.