CLI returns exit code 0 even when an error occurs
Thomas Segismont
tsegismo at redhat.com
Thu Nov 21 13:15:16 UTC 2013
Hi everyone,
Yesterday evening I was adding some tests to the Maven plugin for Agent
plugins I started some time ago:
https://github.com/rhq-project/rhq-agent-plugin-plugin
In particular, for the exec CLI command/script mojos. Here are the test
POMs:
https://github.com/rhq-project/rhq-agent-plugin-plugin/blob/master/src/itest/exec-cli-command/pom.xml
https://github.com/rhq-project/rhq-agent-plugin-plugin/blob/master/src/itest/exec-cli-script/pom.xml
These mojos have a 'failOnError' attribute. So I wanted to write a test
with a failing CLI script. For example:
====
throw "An error"
====
(You can throw any object in Javascript)
When you run the CLI with such a command/script you actually see a
JavascriptException. But the CLI exit code is 0
I think it's a bug, but I'm asking in case this is intentional.
Thanks,
Thomas
More information about the rhq-devel
mailing list