Service Virtualization

 View Only
  • 1.  Unable to print properties of vsm using a JAR

    Posted Jul 20, 2020 02:41 AM
    Hi ,

    I am facing some issues when i tried to print some properties from Responder step of vsm. Below is the link i have used as a reference.
    https://community.broadcom.com/communities/community-home/digestviewer/viewthread?MID=748292

    Below is the sample code i have written in the JAR 

    public void updateResponse(TestExec testExec, TransientResponse response) {
    String responseSent = testExec.getLastResponse().toString();
    com.itko.VSE.info(testExec, "Response", responseSent);
    }
    This same code works in Execute Script step without a method after Responder step but fails when i write it as a JAR.

    Could someone please guide me on the steps to print any vsm property using a JAR.




    ------------------------------
    Thanks,
    Varun Chand
    ------------------------------


  • 2.  RE: Unable to print properties of vsm using a JAR

    Posted Jul 20, 2020 04:12 AM
    Hi Varun,

    Have you created the extension file for the same. If yes, then please check if the name of property includes the package name or not (it should include package names as well).

    Thanks

    ------------------------------
    Regards,
    Vaibhav Jain
    Capgemini
    ------------------------------



  • 3.  RE: Unable to print properties of vsm using a JAR

    Posted Jul 20, 2020 04:57 PM
    Hi Vaibhav,

    Thanks for replying.
    Yes, i have added the package name and am able to see the Jar as well in the Data Protocol Filter. The same JAR works when  i put it under Listener Step.

    ------------------------------
    Thanks,
    Varun Chand
    ------------------------------



  • 4.  RE: Unable to print properties of vsm using a JAR

    Posted Jul 21, 2020 12:09 AM
    Hi Varun,

    In which step you are invoking it (I meant, where exactly you are getting error with the jar)

    Thanks

    ------------------------------
    Regards,
    Vaibhav Jain
    Capgemini
    ------------------------------



  • 5.  RE: Unable to print properties of vsm using a JAR

    Posted Jul 23, 2020 11:55 AM
    Hi Vaibhav,

    I am not getting any error with the JAR.

    Objective of the JAR :
        Print response of a particular step.

    Issue : 
       When i put the jar as a data protocol filter under Listener step I am able to print the response of listener step. But when i use the same jar as a data protocol filter under responder step i am unable to print the response of responder step. I am unable to print neither response nor any of the properties that are defined under responder step.

    ------------------------------
    Thanks,
    Varun Chand
    ------------------------------



  • 6.  RE: Unable to print properties of vsm using a JAR
    Best Answer

    Posted Jul 23, 2020 03:16 PM
    Hi Varun,

    If you want to print the response of each step, you can directly use the inbuilt functionality to store step response in a property and then use that property to save it in a file.

    Thanks

    ------------------------------
    Regards,
    Vaibhav Jain
    Capgemini
    ------------------------------