Saving Decompression Results
Hey Parasoft,
I am testing a REST client that is returning a zip file that I need to use later to verify results. I am trying to use the Decompression Tool. So how do I save the files that the Decompression Tool extracts?
Thanks,
Bryan Cox
Comments
-
I ideally I would like SOAtest to:
For each file in the zip file (they will be csv) -> save the info in each file to a varable.0 -
The Decompression tool can decompress a document that's compressed with gzip, zip, or deflate compression methods. It can not be used to extract files from a zip archive. For that, you could consider using the External tool to execute an unzip command. For Linux that could be "/usr/bin/unzip" and for Windows that could be something else, like 7-zip. The "jar" command from the java runtime can also be used to extract files from zip archives.
0 -
Hey Parasoft,
Thanks for the quick feedback.
So where do the results of the Decompression tool go?
Thanks,
Bryan
0 -
To get the results, you need to attach a tool to the output of the Decompression Tool. In this case you can attach a Write File tool to write the decompressed content to disk. But as @benken_parasoft said, if it's a zip file you probably should use an External Tool to decompress the zip file. Once the csv files are in a directory, then you can put them into a File Data Source to enable parameterizing tests with the data.
0 -
I'm saying you can't use the Decompression tool. It is not used to extract files from a zip archive. You need to use some other tool to do that, like one of the ones I mentioned.
0