Forum Discussion

BA_Service_Haus's avatar
BA_Service_Haus
Regular Contributor
12 years ago

[RESOLVED] How to inlcude data source files in a mock?

Hi,

we really appreciate the "Deploy as War" feature.
But now we are facing a problem.
For a quiet smart mock, we use external csv-Files as data sources, which are read in the start script (using relative paths like "/data/file_name.csv".
But when creating the mock, these files are not included.

Is it possible to include these data? (if so, how can we do it?)

Best regards
Nico

4 Replies

  • I do the same thing, how are you deploying your WAR file?


    We use ANT to build and deploy the SOAPUI test and just include a step in the ANT script to copy the data source directory into the correct location after Tomcat deploys the mockservice.

    If I'm running manually I just have to remember to copy the files there manually as well.
  • BA_Service_Haus's avatar
    BA_Service_Haus
    Regular Contributor
    Hi,

    we don't want to copy the data manually but include them within the war-file when generating (which seems to be difficult, as only the groovy code knows about the file). Maybe there is a way to include files from a certain folder into the war-file.

    Anyway we not using Tomcat but WLS. Unfortunately I don't know the right location to copy the data-files.
    Do you know?
  • Hi there.

    You can include any file you want in the war by following this procedure:

    - Create a War as normal, selecting an empty War Directory (say /home/wars/app1/).
    - Get into that folder... you will see SoapUI created a 'default' WEB-INF folder for you with some other files that will make the war usable.
    - Now, add your data files somewhere inside this folder (by hand or using a script).
    - Create the War again, pointing to the same War Directory.

    Now, the files you've added should be included in the war file.

    Regards,

    Renato
    SmartBear Software