Skip to Content

Some good news…

The ABAP Mocking Framework presented last year is now Open Source.

The namespace has been changed to Z* in order to allow every interested developer to participate in the development of this tool.

Feel free to participate in the development process and visit the project page at Github.

Current Features

  • Mocking of ABAP interfaces and non-final classes
  • Conditional returning of RETURNING, EXPORTING and CHANGING parameters for methods based on specific parameter combinations of IMPORTING and CHANGING parameters.
  • You can even define different output each time when the method is called multiple times with the same parameter values
  • raiseable exceptions
  • verification of mocked method call count

How to start

Functional gaps

  • Documentation (currently there are only two unit test reports)
  • Verification of mocked method calls against certain expected parameter input
  • Register pattern based method signatures for mocked methods

Credits

Thanks to leogistics GmbH, the formerly internal project is now open source. leogistics has decided to provide it as open source software to strengthen the SAP Netweaver and its ABAP development capabilities, and, of course to allow the community to benefit from this tool and make it even better.

To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

  1. Paul Hardy

    Hooray!

    It is always good to end the week on a high note, this is fantastic news.

    I am going to give this a good old work out, and i hope to be able to give something back, which thankfully I was able to do for the ABAP2XLS project.

    Cheersy Cheers

    Paul

    I downloaded the SAPLINK file from GITHUB and installed it on my system .

    The ZIF_MOCKA_MOCKER_METHOD intereface did not compile, due to missing custom type defintions. maybe SAPLINK has a problem with these.

    I guessed TY_T_NAME_PAIR should be defined something like this:-

    BEGIN OF TY_NAME_VALUE_PAIR,

      NAME TYPE ABAP_PARMNAME,

      VALUE TYPE STRING, (not sure about this)

    END OF TY_NAME_VALUE_PAIR.

    TYPES: TY_T_NAME_VALUE_PAIR TYPE STANDARD TABLE OF TY_NAME_VALUE_PAIR.

    When it comes to TY_T_CLASS I am guessing. i think it is a table of xception class names.

    TYPES: BEGIN OF TY_CLASS,

      EXCEPTION TYPE SEOCLSNAME,

    END OF TY_CLASS.

    TYPES: TY_T_CLASS TYPE STANDARD TABLE OF TY_CLASS WITH KEY EXCEPTION.

    That enabled the interface to compile .. how close did I get?

    (0) 
  2. Kay Streubel

    Hi Paul,

    not sure what happened there, it worked flawlessly with my Saplink installation.

    Anyway, why don’t you simply check out the nugget file, starting at line 1755 you will find the ZIF_MOCKA_MOCKER_METHOD interface containing the type definitions.

    Best regards,

    Kay

    (0) 

Leave a Reply