Return-Path: X-Original-To: apmail-jmeter-user-archive@www.apache.org Delivered-To: apmail-jmeter-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 28AD0DA0E for ; Fri, 2 Nov 2012 20:42:10 +0000 (UTC) Received: (qmail 63380 invoked by uid 500); 2 Nov 2012 20:42:09 -0000 Delivered-To: apmail-jmeter-user-archive@jmeter.apache.org Received: (qmail 63354 invoked by uid 500); 2 Nov 2012 20:42:09 -0000 Mailing-List: contact user-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JMeter Users List" Delivered-To: mailing list user@jmeter.apache.org Received: (qmail 63345 invoked by uid 99); 2 Nov 2012 20:42:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2012 20:42:09 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sebbaz@gmail.com designates 209.85.212.43 as permitted sender) Received: from [209.85.212.43] (HELO mail-vb0-f43.google.com) (209.85.212.43) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2012 20:42:03 +0000 Received: by mail-vb0-f43.google.com with SMTP id fq11so4534546vbb.2 for ; Fri, 02 Nov 2012 13:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ieocJF13maUv5nYFtAVtuf4Ac4pwiSNsQk42h/GeHdI=; b=SemQ/MWe1JC8gqTFJ3B/4Ez45zJkDw2BiRkunXlD+mn34kFVMfEmUqXrLJqhl+hofO lUpe0LWv7ftxirCtubrazgxuq6OTsfBoLvz8QCPy8Vd95mvTKrZsB2kNOb/eSP6VK/pA /5wO7NAdSEpVjg663147SobrfhwxhidQhXQsarC3CMqo+UC7sP28EdsguO+orDzpDG1I mqea3DRask75IyScbZJVlj6IGJPOyIsp6rVALQYUa31W5yPBG3nIiHfPdEB7te+cp38q paTz047od5qglUaozaxpjnZ/bNFJqrxQiheJif7+e4STrzICcfEshB3dmGol7F+2SjNn UJzg== MIME-Version: 1.0 Received: by 10.52.24.231 with SMTP id x7mr2545107vdf.121.1351888902465; Fri, 02 Nov 2012 13:41:42 -0700 (PDT) Received: by 10.58.172.71 with HTTP; Fri, 2 Nov 2012 13:41:42 -0700 (PDT) In-Reply-To: <1350580272720-5715096.post@n5.nabble.com> References: <1350580272720-5715096.post@n5.nabble.com> Date: Fri, 2 Nov 2012 20:41:42 +0000 Message-ID: Subject: Re: exiting with an error return code on when Assertion Test fails From: sebb To: JMeter Users List Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On 18 October 2012 18:11, Lyle wrote: > I am using JMeter in command-line mode on Solaris, not for load-testing, but > for functional testing a website. In the name of writing a Nagios plug-in to > monitor the website, I need the JMeter to exit with an error return code if > an Assertion Test fails. > > So I've got a Sampler with an Assertion Test child. I'm guessing I have to > somehow determine if the Test failed, maybe do some post-processing to > determine the text of the error, and exit with a specific error code. > > Any advice? Thanks...Lyle > JMeter does not call System.exit(int) except when a serious error occurs. This is to allow embedded usage. I can think of two options: 1) write the sample results to a JTL file, and post-process that to determine if the test succeeded or not. 2) write an Assertion element using Beanshell or BSF that invokes System.exit() with non-zero code. JMeter uses exit(1) for severe error. There may be other approaches. > > -- > View this message in context: http://jmeter.512774.n5.nabble.com/exiting-with-an-error-return-code-on-when-Assertion-Test-fails-tp5715096.html > Sent from the JMeter - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org > For additional commands, e-mail: user-help@jmeter.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org For additional commands, e-mail: user-help@jmeter.apache.org