Service Virtualization

  • 1.  I have developed a test case work flow where i need to invoke a custom data protocol handler.

    Posted Sep 12, 2017 08:26 AM

    Data protocol handler works very well for virtual services. Is it the same way for Service testing as well? Or do we need to make any modifications to invoke the custom DPH for service testing?



  • 2.  Re: I have developed a test case work flow where i need to invoke a custom data protocol handler.

    Posted Sep 12, 2017 09:16 AM

    You can create custom scripts, filters, assertions and roll-your-own classes that can be executed in test cases, but before we go down that path, can you explain more about the requirements you want the test case to handle?

     

    Data Protocol Handlers have very specific implementations in the context of Virtual Services. DPHs implement overrides to framework methods that deal with incoming request and / or outgoing response objects. These request/response objects are not typically available in Test Cases which reduces what a DPH can do.



  • 3.  Re: I have developed a test case work flow where i need to invoke a custom data protocol handler.

    Posted Sep 13, 2017 12:51 AM

    Thanks for your reply Joel Nesmith . My test case works as follows:

    I will build a request with some parameters being created on runtime and hit against a service which is under test. I have to capture the response and store it in a excel sheet and validate against the values present in some DB.

    The reason why am going for custom DPH here is that the response structure is varying and I have written a java code which will handle all kinds of response and convert into excel sheet.

    Can you please help?



  • 4.  Re: I have developed a test case work flow where i need to invoke a custom data protocol handler.
    Best Answer

    Posted Oct 04, 2017 06:00 PM

    Sorry for the late reply. You can invoke class methods using the JSR-223 step.

    If the custom DPH JAR has some utility class / method, you should be able to call that method - assuming the everything is public and you have instances of the objects required by the signature.

     

    I would be cautious of calling the DPHs updateRequest / updateResponse methods from a test case. Since a custom DPH is an extension of DevTest framework classes, there could be unintended side effects.