The default command line tester does not allow args on the comandLine node.
In some cases, to test the command, we need to pass args.
eg. Blender is a GUI application, to work headless, we need to pass the -b (background) argument.
Proposed solution (advanced by Florent Guillaume):
- Add to CommandLineDescriptor an optional testParameterString (also winTestParameterString) xml element;
- Add getTestParametersString() method;
- Change SystemPathExistTester to use these test parameters on command runtime exec.
It's now possible in the extension point for a command to include a <testParameterString>:
<extension target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent" point="command"> <command name="mycommand"> <commandLine>somecommand</commandLine> <parameterString>arg1 --arg2 --arg3</parameterString> <winCommand>somecommand.exe</winCommand> <winParameterString>arg1 /arg2 /arg3</winParameterString> <testParameterString>--exists</testParameterString> <winTestParameterString>/exists</winTestParameterString> </command> </extension>