I need to test my java application with JUnit4 but my application runs with a .bat file. I would need to run this .bat file in the @Before method but I don't know how can I do it.
Can you help me?
Thanks.
I need to test my java application with JUnit4 but my application runs with a .bat file. I would need to run this .bat file in the @Before method but I don't know how can I do it.
Can you help me?
Thanks.
This:
Runtime.getRuntime().exec("cmd /c start filename.bat");
should do the magic ;)
For more Information see: Java docs: Runtime