webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Adapter not properly mocked on distant IS environment

    Posted 30 days ago

    Hello team,

    One of my customer is having some troubles running Test suite, when it involves using an adapter on a distant Integration Server.

    They have mocked the input, locally it works and they don't need the Adapter to be connected. But when they are trying to execute the test on a distant Integration Server we have Adapters errors:

    Unable to invoke adapter service C014_socle.adapter.insert:sftpDonneeIn with connection C014_socle.connection:socleWrite.
    [junit] [ART.117.4012] Adapter Runtime (Adapter Service): Unable to run adapter service. Error occurred when connecting to resource C014_socle.connection:socleWrite.

    And when the adapter is activated, the call is made and doesn't seems to take the mock in consideration.

    Do we need a additional parameter or any specific setup to allow the mocking on adapters on distant Integration Servers ? (We cannot activate all adapters on distant IS, as they don't have all the databases available.)

    Thank you



    ------------------------------
    Alexandre Trin
    ------------------------------


  • 2.  RE: Adapter not properly mocked on distant IS environment

    Posted 9 days ago

    Hi Alexandre,

    it might have to do with the scope of the mock. There are possibilities:

    • user
    • session
    • server/global

    Usually session is the one you need. This makes sure that other users don't experience the mock. This is also applies when you're testing against a remote IS.

    If changing the scope to 'server/global' does not help, then I suspect that the mocking facility is not working correcly. Make sure that the package WmServiceMock is present and active on the remote IS. You can verify this by inspecting the java stack trace trace that you see when an exception is thrown. You should see the class/method

        com.wm.ps.serviceMock.ServiceInterceptor.process()

    just below the custom invoke chain processors that are visible in the screenshot you uploaded:

        fr.gifi.wm.monitor.manager.processor.AbstractMonitorInvokeProcessor.process()

    If you don't see the ServiceInterceptor, then reload the WmServiceMock package. 

    Good luck!



    ------------------------------
    Ido-Eduard de Baat
    ------------------------------



  • 3.  RE: Adapter not properly mocked on distant IS environment

    Posted 9 days ago

    Hi Alexandre,

    it might have to do with the scope of the mock. There are possibilities:

    user
    session
    server/global

    Usually session is the one you need. This makes sure that other users don't experience the mock. This is also applies when you're testing against a remote IS.

    If changing the scope to 'server/global' does not help, then I suspect that the mocking facility is not working correcly. Make sure that the package WmServiceMock is present and active on the remote IS. You can verify this by inspecting the java stack trace trace that you see when an exception is thrown. You should see the class/method

        com.wm.ps.serviceMock.ServiceInterceptor.process()

    just below the custom invoke chain processors that are visible in the screenshot you uploaded:

        fr.gifi.wm.monitor.manager.processor.AbstractMonitorInvokeProcessor.process()

    If you don't see the ServiceInterceptor, then reload the WmServiceMock package. 



    ------------------------------
    Ido-Eduard de Baat
    ------------------------------



  • 4.  RE: Adapter not properly mocked on distant IS environment

    Posted 9 days ago

    Hi Alexandre,

    it might have to do with the scope of the mock. It can be one of

    • user
    • session
    • global

    'session' is the default and is usually the one that you need, also when executing against a remote IS. If changing it to 'global' does not work, then I suspect that the mocking facility is not working properly. Make sure that the package WmServiceMock is present and active on the remote IS. 

    You should see in the error stack trace the following class: 

        at com.wm.ps.serviceMock.ServiceInterceptor.process()

    below the custom processors 

        fr.gifi.wm.monitor.manager.processor.AbstractMonitorInvoke.process()

    Good luck.



    ------------------------------
    Ido-Eduard de Baat
    ------------------------------



  • 5.  RE: Adapter not properly mocked on distant IS environment

    Posted 6 days ago
    Edited by Alexandre Trin 6 days ago

    thanks @Ido-Eduard de Baat, we'll check this with the customer team.

    Support also suggested to check that package WmServiceMock is present, and it may also be an issue with the container/image built by customer. I paste below what Support suggested : 

    To mock a service, only requirement is to have the Unit Test Framework Integration Server package i.e. WmServiceMock. Mocking happens within server, therefore local or remote connection has no effect.

    The issue is not reproducible at our end when we tried with remote MSR. The issue could be specific to the container/image you built.

    Please perform the following steps and share the result:

    1. Install MSR remotely with all fixes and WmServiceMock package.
    2. Install SampleTestSuite package as well, which can be generated via local Designer and copy to remote server packages location. The Package has inbuilt mocks for DB adapter services.
    3. You should be able to run the tests of SampleTestSuite project in Designer locally, pointing to the remote MSR which should have the same package.
    4. Check if it helps or the same error gets thrown again. Above steps can help detecting the changes required in other MSR containers.

    I will keep you informed of the customer return.



    ------------------------------
    Alexandre Trin
    ------------------------------