Finally, try ant

In my ant script that runs end-to-end integration tests, I start the process first, then do some other things, then run the tests, and then I need to make sure that I kill the process. However, I need to make sure that I kill this process, even if something doesn't work (so I need an equivalent to try at the end). What is the recommended way to do this?

+4
source share
1 answer

You can use the trycatch task from Antcontrib

<trycatch property="error.message"> <try> <echo message="Run integration test..."/> <echo message="Start process"/> <antcall target="launchTests"/> </try> <catch> <echo message="Integration test failed"/> </catch> <finally> <echo message="Kill the process"/> <exec executable="kill -9 ..."/> </finally> </trycatch> 
+9
source

Source: https://habr.com/ru/post/1309569/


All Articles