Skip to Content
author's profile photo Former Member
Former Member

CAF 7.1 and JUnit

Hello Kollegues,

I am searching fort an ability to run JUnit tests with the CAF 7.1 projects. I use RFC external services and would like to cover the compositions of them with automatic unit tests which should run locally (not on server). Unfortunately SAP does not provide any documentation about that. All you can find about JUnit enablement is very old and not really applicable for that case. What is really needed is an ability to mock the calls for getting JCo clients.

I canu2019t imagine that CAF services cannot be tested automatically!

I appreciate your hints!

Dimitri

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Dec 19, 2008 at 09:12 AM

    Hi Dimitri,

    Unfortunately, not only the JCo clients need to be mocked. All mappings between the RFC function and the Application Service method are described in the model and are executed at runtime.

    At the moment the easiest way to automatically test external services composition is to write JUnit tests that call the corresponding CAF services at runtime.

    One more idea is to override the Application Service method that calls the external service and mock the call and the mappings. You can do this in the "*Impl" file for the service.

    Please let me know if you need more information for some of the solutions above.

    Bets Regards,

    Tsvetan

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Tsvetan,

      thanks for the very quick answer!

      It is now clear to me, that only calls on server will succeed. Is there any other option? That actually means that every code change must be deployed before testing it. Is there actually a JUnit tests runner on server (a standard application which can run DCs with tests)?

      I didnu2019t understand you second idea. Do you mean to mock service calls completely, so that you can run tests locally with e.g. static data without going via RFC? That would not help hence my wish is to test the communication with R/3 as wellu2026

      Thanks again for the hints!

      Dimitri

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.