Forum Discussion

Lavalyte's avatar
Lavalyte
Occasional Contributor
8 years ago

Deployed mock server script directory

This is related to my previous question...

 

If you create and deploy a mock server war, is there a directory you can add to the deployment where soapui will pick up groovy scripts that contain classes and methods that can be called by the deployed mock scriptlets?

 

 

  • Lavalyte's avatar
    Lavalyte
    Occasional Contributor

    One suggestion I've seen is to compile groovy code into a jar and include that in the deployed war.

    Has anyone done that with open source soap UI?

    • rupert_anderson's avatar
      rupert_anderson
      Valued Contributor

      Hi,

       

      Yes, that works in SoapUI O/S.

       

      As a quick test with version 5.2.1, I created a test Groovy library jar as per:

       

      http://rupertanderson.com/blog/1-how-to-develop-add-and-use-a-custom-groovy-library-in-soapui/

       

      When generating the mock using 'deploy as war' I ticked the 'Include external Jar Files' option as below:

       

      This resulted in my soapuilib-1.0-sample.jar being copied into the mock war's WEB-INF/lib folder along with all the other jar files.

       

      In my mock response script I was able to call the custom jar e.g.

       

       

      Requests to the mock when deployed on Tomcat 8 were successful.

       

      Regards,

      Rupert 

       

      • Lavalyte's avatar
        Lavalyte
        Occasional Contributor

        Thanks,

         

        I'd done a similar test myself.

        It would be nice if this was bound at the project level rather than the installation level.