On 7 February 2013 23:40, Mark Miller <[email protected]> wrote: > Thanks Shmuel. I did find that suggestion that you'd made on that thread > and I experimented with it. It did work. However, I wondered that it might > be overly 'abrupt' in terms of JMeter exiting and finishing writing other > listeners (file handling), etc. I have not taken the time to look into > this, though. The strength of that approach is that it is more portable. > > Do you happen to know how JMeter handles it's own termination under a > System.exit via BeanShell?
Same as for any other Java application. AFAIK there's no way to catch System.exit - and anyway JMeter does not try. > Mark > > > On Thu, Feb 7, 2013 at 4:15 PM, Shmuel Krakower <[email protected]> wrote: > >> >> http://jmeter.512774.n5.nabble.com/exiting-with-an-error-return-code-when-Assertion-Test-fails-td5715096.html >> >> ("....you can use the "System.exit(ERROR_CODE);" inside a beanshell >> sampler.") >> >> Shmuel Krakower. >> www.Beatsoo.org - re-use your jmeter scripts for application performance >> monitoring from worldwide locations for free. >> >> >> On Thu, Feb 7, 2013 at 9:09 PM, Mark Miller <[email protected]> >> wrote: >> >> > I am in the process of integrating *discreet, functional unit >> > tests*(leveraging several JMeter capabilities) with an enterprise >> > monitoring >> > system (Orion). The monitoring system can integrate with any executable >> > based on exit status. >> > >> > I've done some searching and read other threads from folks seemingly >> > searching for a similar capability. >> > >> > I've come up with and successfully tested the following solution and >> wanted >> > to float it to the community to ask for feedback or other suggestions: >> > >> > In the tesplan, I include a Generate Summary Results listener. >> > I wrap the execution of JMeter in a simple shell script used to evaluate >> > the string put to stdout by the listener: >> > >> > #!/bin/bash >> > if java -jar ./apache-jmeter-2.9/bin/ApacheJMeter.jar -n -t x.jmx | grep >> "0 >> > (0.00%)$" >> > then >> > echo Success >> > exit 0 >> > else >> > echo Failure >> > exit 1 >> > fi >> > >> > I have noted that, in a long running test, Generate Summary Results will >> > output n+ lines over time. But it seems safe that the final line output >> > terminates ($) with the final overall error rate. >> > >> > Anyone have any other cautions / considerations / approaches to this? >> > >> > Thank you. >> > >> > Mark >> > >> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
