Return-Path: Delivered-To: apmail-jakarta-jmeter-user-archive@www.apache.org Received: (qmail 47026 invoked from network); 2 Jul 2004 13:09:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Jul 2004 13:09:29 -0000 Received: (qmail 83342 invoked by uid 500); 2 Jul 2004 13:09:26 -0000 Delivered-To: apmail-jakarta-jmeter-user-archive@jakarta.apache.org Received: (qmail 83272 invoked by uid 500); 2 Jul 2004 13:09:25 -0000 Mailing-List: contact jmeter-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "JMeter Users List" Reply-To: "JMeter Users List" Delivered-To: mailing list jmeter-user@jakarta.apache.org Received: (qmail 83256 invoked by uid 99); 2 Jul 2004 13:09:25 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received: from [192.12.40.33] (HELO mailrelay03.uk.atosorigin.com) (192.12.40.33) by apache.org (qpsmtpd/0.27.1) with ESMTP; Fri, 02 Jul 2004 06:09:23 -0700 Received: from [157.203.40.61] (helo=lonns01.sema.co.uk) by mailrelay03.uk.atosorigin.com with esmtp (Exim 4.32) id 1BgNnt-0007Em-Uz for jmeter-user@jakarta.apache.org; Fri, 02 Jul 2004 14:10:10 +0100 Received: from lones1.sema.co.uk (unverified) by lonns01.sema.co.uk (Content Technologies SMTPRS 4.2.10) with ESMTP id for ; Fri, 2 Jul 2004 14:08:53 +0100 Received: by lones1.sema.co.uk with Internet Mail Service (5.5.2657.72) id ; Fri, 2 Jul 2004 14:08:55 +0100 Message-ID: From: "BAZLEY, Sebastian" To: 'JMeter Users List' Subject: RE: BeanShell Date: Fri, 2 Jul 2004 14:09:12 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-yoursite-MailScanner-Information: Please contact the ISP for more information X-yoursite-MailScanner: Not scanned: please contact your Internet E-Mail Service Provider for details X-MailScanner-From: sebastian.bazley@atosorigin.com X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N >-----Original Message----- >From: Jean-Denis Giguere [mailto:jdenisgiguere@fastmail.fm] >Sent: 02 July 2004 13:52 >To: JMeter Users List >Subject: BeanShell > > >Hi list, > >I would like to use the __BeanShell function but I don't find=20 >answers to=20 >my questions in the jmeter doc. If someone use this function and can=20 >answer my questions, it will be really appreciated. > >1. Which way can we pass the script in argument ? (Ralative path from=20 >where we launch jmeter, relative path from jmeter bin,=20 >absolute path or=20 >you have to write directly the script as argument ?) The script parameter is just that - a script, not a file containing a script. >2.Can we pass arguments to the script ? >(ex. ${__BeanShell(myscript.bsh foo 13,answer)} You can use function calls in the script paramater string. >4. Can we pass the name of the script as a variable ? >(ex. ${__BeanShell(${myScript},answer)} See 1. The script does not have a "name". But you can pass a script in a variable. > >3. The doc says that this function return the "result" of the script=20 >passed in argument. How do you define the result of the script=20 >? (Is it=20 >the last variable assignation, the return of the main=20 >function, the last=20 >print ?) See the BeanShell documentation for details, but IIRC, it will use the return value or failing that the last assignment (it may even return the last value). > >If someone has an exemple and would accept to share it (with the=20 >function call and the result), it can help me very much. ${__BeanShell(return "abcd";)} -> abcd ${__BeanShell(return "${__threadNum()}";)} -> same as ${__threadNum()} ${__BeanShell(return Threads.currentThread().getName();)} should return the current thread name I think you can probably omit the return statement - try it and see. Note that the current implementation is not as efficient as it could be - the script is parsed anew each time, even if it has not been changed. What do you want to use it for? > >Thank you for your attention, > >Jean-Denis Gigu=E8re > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: jmeter-user-help@jakarta.apache.org > ___________________________________________________________________________ This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Origin group liability cannot be triggered for the message content. Although the sender endeavours to mainta= in a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.=20 ___________________________________________________________________________ --------------------------------------------------------------------- To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: jmeter-user-help@jakarta.apache.org