Service Virtualization

  • 1.  Where And how to execute below java code in Devtest LISA?

    Posted Jun 22, 2017 04:08 AM

    Hi,

    I am trying to build the dynamic response at runtime from request with below java code.

     

     

     



  • 2.  Re: Where And how to execute below java code in Devtest LISA?
    Best Answer

    Posted Jun 22, 2017 06:59 AM

    Hello kartik.audichya

     

    You can execute the execute the Java code using Dynamic Java Execution Step. However, I haven't tried this yet.

    Refer below

    https://docops.ca.com/devtest-solutions/10-1/en/reference/test-step-descriptions/java-j2ee-steps/dynamic-java-execution

     

    I generally use the Execute Script (JSR -223) Step for any scripting using Beanshell scripting.

    Its very much similar to java where you need not create any objects / classes / require main to execute. Import statements should be provided.

     

    In your case , for setting the Value of Str to property - you need to use testExec.setStateValue("propertyname", "value")

     

    Lastly, if you were doing this for your following question

    https://communities.ca.com/thread/241779182-virtualization-of-soap-request-with-dynamic-response-with-lisa-9516

    then, you can try the suggestion I have provided in the answer.

     

    Thanks,

    Venkatesh



  • 3.  Re: Where And how to execute below java code in Devtest LISA?

    Broadcom Employee
    Posted Jun 26, 2017 08:14 AM

    If you are just attempting to get the response to respond with "true" or "false" depending on what's in the input, these values can be automatically correlated without any scripting. By default, DevTest ignores those values, because it is too easy to get false matches with such widely-used terms, but that behaviour can be changed by editing the file DEVTEST_HOME/lisa.properties (or copying these lines into DEVTEST_HOME/local.properties) and removing the "true, True, TRUE, false, False, FALSE," pieces:

     

    # This allows you to exclude certain strings from being eligible
    # for magic stringing.

    lisa.magic.string.exclusion=Yes, YES, yes, No, NO, no, true, True, TRUE, false, False, FALSE, __NULL