Author: sebb Date: Wed Sep 19 09:29:45 2007 New Revision: 577345 URL: http://svn.apache.org/viewvc?rev=577345&view=rev Log: Add support for Parameters and scriptfile to BeanShell TestBean Gui elements
Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/BeanShellPostProcessor.java jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/BeanShellPostProcessorBeanInfo.java jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/BeanShellPostProcessorResources.properties jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/BeanShellPreProcessor.java jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/BeanShellPreProcessorBeanInfo.java jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/BeanShellPreProcessorResources.properties jakarta/jmeter/trunk/src/components/org/apache/jmeter/timers/BeanShellTimer.java jakarta/jmeter/trunk/src/components/org/apache/jmeter/timers/BeanShellTimerBeanInfo.java jakarta/jmeter/trunk/src/components/org/apache/jmeter/timers/BeanShellTimerResources.properties jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/BeanShellListener.java jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/BeanShellListenerBeanInfo.java jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/BeanShellListenerResources.properties jakarta/jmeter/trunk/src/core/org/apache/jmeter/testbeans/BeanInfoSupport.java jakarta/jmeter/trunk/xdocs/images/screenshots/beanshell_listener.png jakarta/jmeter/trunk/xdocs/images/screenshots/beanshell_postprocessor.png jakarta/jmeter/trunk/xdocs/images/screenshots/beanshell_preprocessor.png jakarta/jmeter/trunk/xdocs/images/screenshots/timers/beanshell_timer.png jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/BeanShellPostProcessor.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/BeanShellPostProcessor.java?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/BeanShellPostProcessor.java (original) +++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/BeanShellPostProcessor.java Wed Sep 19 09:29:45 2007 @@ -35,7 +35,7 @@ { private static final Logger log = LoggingManager.getLoggerForClass(); - private static final long serialVersionUID = 3; + private static final long serialVersionUID = 4; // can be specified in jmeter.properties private static final String INIT_FILE = "beanshell.postprocessor.init"; //$NON-NLS-1$ @@ -50,6 +50,7 @@ SampleResult prev = jmctx.getPreviousResult(); final BeanShellInterpreter bshInterpreter = getBeanShellInterpreter(); if (prev == null || bshInterpreter == null) { + log.error("BeanShell not found"); return; } @@ -60,7 +61,7 @@ bshInterpreter.set("vars", vars);//$NON-NLS-1$ bshInterpreter.set("prev", prev);//$NON-NLS-1$ bshInterpreter.set("data", prev.getResponseData());//$NON-NLS-1$ - bshInterpreter.eval(getScript()); + processFileOrScript(bshInterpreter); } catch (JMeterException e) { log.warn("Problem in BeanShell script "+e); } Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/BeanShellPostProcessorBeanInfo.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/BeanShellPostProcessorBeanInfo.java?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/BeanShellPostProcessorBeanInfo.java (original) +++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/BeanShellPostProcessorBeanInfo.java Wed Sep 19 09:29:45 2007 @@ -18,23 +18,12 @@ package org.apache.jmeter.extractor; -import java.beans.PropertyDescriptor; +import org.apache.jmeter.util.BeanShellBeanInfoSupport; -import org.apache.jmeter.testbeans.BeanInfoSupport; -import org.apache.jmeter.testbeans.gui.TextAreaEditor; - -public class BeanShellPostProcessorBeanInfo extends BeanInfoSupport { +public class BeanShellPostProcessorBeanInfo extends BeanShellBeanInfoSupport { public BeanShellPostProcessorBeanInfo() { super(BeanShellPostProcessor.class); - - createPropertyGroup("scripting", new String[] { "script" }); - - PropertyDescriptor p = property("script"); - p.setValue(NOT_UNDEFINED, Boolean.TRUE); - p.setValue(DEFAULT, ""); - p.setPropertyEditorClass(TextAreaEditor.class); - } } Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/BeanShellPostProcessorResources.properties URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/BeanShellPostProcessorResources.properties?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/BeanShellPostProcessorResources.properties (original) +++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/BeanShellPostProcessorResources.properties Wed Sep 19 09:29:45 2007 @@ -1,4 +1,10 @@ displayName=BeanShell PostProcessor -scripting.displayName=BeanShell (variables: ctx vars prev data) -script.displayName=Script -script.shortDescription=Beanshell script \ No newline at end of file +scripting.displayName=Script (variables: ctx vars prev data log) +script.displayName= +script.shortDescription=Beanshell script +parameterGroup.displayName=Parameters to be passed to BeanShell (=> String Parameters and String []bsh.args) +parameters.displayName=Parameters +parameters.shortDescription=Parameters to be passed to BeanShell (file or script) +filenameGroup.displayName=Script file (overrides script) +filename.displayName=File Name +filename.shortDescription=BeanShell script file (overrides script) \ No newline at end of file Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/BeanShellPreProcessor.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/BeanShellPreProcessor.java?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/BeanShellPreProcessor.java (original) +++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/BeanShellPreProcessor.java Wed Sep 19 09:29:45 2007 @@ -36,7 +36,7 @@ { private static final Logger log = LoggingManager.getLoggerForClass(); - private static final long serialVersionUID = 3; + private static final long serialVersionUID = 4; // can be specified in jmeter.properties private static final String INIT_FILE = "beanshell.preprocessor.init"; //$NON-NLS-1$ @@ -48,7 +48,8 @@ public void process(){ final BeanShellInterpreter bshInterpreter = getBeanShellInterpreter(); if (bshInterpreter == null) { - return; + log.error("BeanShell not found"); + return; } JMeterContext jmctx = JMeterContextService.getContext(); JMeterVariables vars = jmctx.getVariables(); @@ -61,7 +62,7 @@ bshInterpreter.set("sampler", sam);//$NON-NLS-1$ bshInterpreter.set("prev", prev);//$NON-NLS-1$ - bshInterpreter.eval(getScript()); + processFileOrScript(bshInterpreter); } catch (JMeterException e) { log.warn("Problem in BeanShell script "+e); } Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/BeanShellPreProcessorBeanInfo.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/BeanShellPreProcessorBeanInfo.java?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/BeanShellPreProcessorBeanInfo.java (original) +++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/BeanShellPreProcessorBeanInfo.java Wed Sep 19 09:29:45 2007 @@ -18,23 +18,12 @@ package org.apache.jmeter.modifiers; -import java.beans.PropertyDescriptor; +import org.apache.jmeter.util.BeanShellBeanInfoSupport; -import org.apache.jmeter.testbeans.BeanInfoSupport; -import org.apache.jmeter.testbeans.gui.TextAreaEditor; - -public class BeanShellPreProcessorBeanInfo extends BeanInfoSupport { +public class BeanShellPreProcessorBeanInfo extends BeanShellBeanInfoSupport { public BeanShellPreProcessorBeanInfo() { super(BeanShellPreProcessor.class); - - createPropertyGroup("scripting", new String[] { "script" }); - - PropertyDescriptor p = property("script"); - p.setValue(NOT_UNDEFINED, Boolean.TRUE); - p.setValue(DEFAULT, ""); - p.setPropertyEditorClass(TextAreaEditor.class); - } } Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/BeanShellPreProcessorResources.properties URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/BeanShellPreProcessorResources.properties?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/BeanShellPreProcessorResources.properties (original) +++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/BeanShellPreProcessorResources.properties Wed Sep 19 09:29:45 2007 @@ -1,4 +1,10 @@ displayName=BeanShell PreProcessor -scripting.displayName=BeanShell (variables: ctx vars prev sampler) -script.displayName=Script -script.shortDescription=Beanshell script \ No newline at end of file +scripting.displayName=Script (variables: ctx vars prev sampler log) +script.displayName= +script.shortDescription=Beanshell script +parameterGroup.displayName=Parameters to be passed to BeanShell (=> String Parameters and String []bsh.args) +parameters.displayName=Parameters +parameters.shortDescription=Parameters to be passed to BeanShell (file or script) +filenameGroup.displayName=Script file (overrides script) +filename.displayName=File Name +filename.shortDescription=BeanShell script file (overrides script) \ No newline at end of file Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/timers/BeanShellTimer.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/timers/BeanShellTimer.java?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/components/org/apache/jmeter/timers/BeanShellTimer.java (original) +++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/timers/BeanShellTimer.java Wed Sep 19 09:29:45 2007 @@ -31,7 +31,7 @@ public class BeanShellTimer extends BeanShellTestElement implements Cloneable, Timer, TestBean { private static final Logger log = LoggingManager.getLoggerForClass(); - private static final long serialVersionUID = 2; + private static final long serialVersionUID = 4; // can be specified in jmeter.properties private static final String INIT_FILE = "beanshell.timer.init"; //$NON-NLS-1$ @@ -58,7 +58,7 @@ // Add variables for access to context and variables bshInterpreter.set("ctx", jmctx);//$NON-NLS-1$ bshInterpreter.set("vars", vars);//$NON-NLS-1$ - Object o = bshInterpreter.eval(getScript()); + Object o = processFileOrScript(bshInterpreter); if (o != null) ret=o.toString(); } catch (JMeterException e) { log.warn("Problem in BeanShell script "+e); Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/timers/BeanShellTimerBeanInfo.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/timers/BeanShellTimerBeanInfo.java?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/components/org/apache/jmeter/timers/BeanShellTimerBeanInfo.java (original) +++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/timers/BeanShellTimerBeanInfo.java Wed Sep 19 09:29:45 2007 @@ -18,23 +18,12 @@ package org.apache.jmeter.timers; -import java.beans.PropertyDescriptor; +import org.apache.jmeter.util.BeanShellBeanInfoSupport; -import org.apache.jmeter.testbeans.BeanInfoSupport; -import org.apache.jmeter.testbeans.gui.TextAreaEditor; - -public class BeanShellTimerBeanInfo extends BeanInfoSupport { +public class BeanShellTimerBeanInfo extends BeanShellBeanInfoSupport { public BeanShellTimerBeanInfo() { super(BeanShellTimer.class); - - createPropertyGroup("scripting", new String[] { "script" }); - - PropertyDescriptor p = property("script"); - p.setValue(NOT_UNDEFINED, Boolean.TRUE); - p.setValue(DEFAULT, ""); - p.setPropertyEditorClass(TextAreaEditor.class); - } } Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/timers/BeanShellTimerResources.properties URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/timers/BeanShellTimerResources.properties?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/components/org/apache/jmeter/timers/BeanShellTimerResources.properties (original) +++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/timers/BeanShellTimerResources.properties Wed Sep 19 09:29:45 2007 @@ -1,4 +1,10 @@ displayName=BeanShell Timer -scripting.displayName=BeanShell (variables: ctx vars) -script.displayName=Script -script.shortDescription=Beanshell script to generate delay \ No newline at end of file +scripting.displayName=Script (variables: ctx vars log) +script.displayName= +script.shortDescription=Beanshell script to generate delay +parameterGroup.displayName=Parameters to be passed to BeanShell (=> String Parameters and String []bsh.args) +parameters.displayName=Parameters +parameters.shortDescription=Parameters to be passed to BeanShell (file or script) +filenameGroup.displayName=Script file (overrides script) +filename.displayName=File Name +filename.shortDescription=BeanShell script file (overrides script) \ No newline at end of file Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/BeanShellListener.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/BeanShellListener.java?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/BeanShellListener.java (original) +++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/BeanShellListener.java Wed Sep 19 09:29:45 2007 @@ -37,7 +37,7 @@ private static final Logger log = LoggingManager.getLoggerForClass(); - private static final long serialVersionUID = 2; + private static final long serialVersionUID = 4; // can be specified in jmeter.properties private static final String INIT_FILE = "beanshell.listener.init"; //$NON-NLS-1$ @@ -62,7 +62,7 @@ bshInterpreter.set("vars", vars);//$NON-NLS-1$ bshInterpreter.set("sampleEvent", se);//$NON-NLS-1$ bshInterpreter.set("sampleResult", samp);//$NON-NLS-1$ - bshInterpreter.eval(getScript()); + processFileOrScript(bshInterpreter); } catch (JMeterException e) { log.warn("Problem in BeanShell script "+e); } Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/BeanShellListenerBeanInfo.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/BeanShellListenerBeanInfo.java?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/BeanShellListenerBeanInfo.java (original) +++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/BeanShellListenerBeanInfo.java Wed Sep 19 09:29:45 2007 @@ -18,23 +18,12 @@ package org.apache.jmeter.visualizers; -import java.beans.PropertyDescriptor; +import org.apache.jmeter.util.BeanShellBeanInfoSupport; -import org.apache.jmeter.testbeans.BeanInfoSupport; -import org.apache.jmeter.testbeans.gui.TextAreaEditor; - -public class BeanShellListenerBeanInfo extends BeanInfoSupport { +public class BeanShellListenerBeanInfo extends BeanShellBeanInfoSupport { public BeanShellListenerBeanInfo() { super(BeanShellListener.class); - - createPropertyGroup("scripting", new String[] { "script" }); - - PropertyDescriptor p = property("script"); - p.setValue(NOT_UNDEFINED, Boolean.TRUE); - p.setValue(DEFAULT, ""); - p.setPropertyEditorClass(TextAreaEditor.class); - } } Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/BeanShellListenerResources.properties URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/BeanShellListenerResources.properties?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/BeanShellListenerResources.properties (original) +++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/BeanShellListenerResources.properties Wed Sep 19 09:29:45 2007 @@ -1,4 +1,10 @@ displayName=BeanShell Listener -scripting.displayName=BeanShell (variables: ctx vars sampleEvent sampleResult) -script.displayName=Script -script.shortDescription=Beanshell script \ No newline at end of file +scripting.displayName=Script (variables: ctx vars sampleEvent sampleResult log) +script.displayName= +script.shortDescription=Beanshell script +parameterGroup.displayName=Parameters to be passed to BeanShell (=> String Parameters and String []bsh.args) +parameters.displayName=Parameters +parameters.shortDescription=Parameters to be passed to BeanShell (file or script) +filenameGroup.displayName=Script file (overrides script) +filename.displayName=File Name +filename.shortDescription=BeanShell script file (overrides script) \ No newline at end of file Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/testbeans/BeanInfoSupport.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/testbeans/BeanInfoSupport.java?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/core/org/apache/jmeter/testbeans/BeanInfoSupport.java (original) +++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/testbeans/BeanInfoSupport.java Wed Sep 19 09:29:45 2007 @@ -148,6 +148,7 @@ return properties[i]; } } + log.warn("Cannot find property: "+name); return null; } Modified: jakarta/jmeter/trunk/xdocs/images/screenshots/beanshell_listener.png URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/images/screenshots/beanshell_listener.png?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== Binary files - no diff available. Modified: jakarta/jmeter/trunk/xdocs/images/screenshots/beanshell_postprocessor.png URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/images/screenshots/beanshell_postprocessor.png?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== Binary files - no diff available. Modified: jakarta/jmeter/trunk/xdocs/images/screenshots/beanshell_preprocessor.png URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/images/screenshots/beanshell_preprocessor.png?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== Binary files - no diff available. Modified: jakarta/jmeter/trunk/xdocs/images/screenshots/timers/beanshell_timer.png URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/images/screenshots/timers/beanshell_timer.png?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== Binary files - no diff available. Modified: jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=577345&r1=577344&r2=577345&view=diff ============================================================================== --- jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml (original) +++ jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml Wed Sep 19 09:29:45 2007 @@ -730,10 +730,16 @@ </p> </description> <properties> - <property name="Name" required="no">Descriptive name for this controller that is shown in the tree.</property> - <property name="Parameters" required="no">List of parameters to be passed to the script file or the script.</property> - <property name="Script File" required="(yes)">Name of a file to be used as a BeanShell script</property> - <property name="Script" required="(yes)">Script to be passed to BeanShell</property> + <property name="Name" required="No">Descriptive name for this controller that is shown in the tree.</property> + <property name="Parameters" required="No">Parameters to pass to the BeanShell script. + The parameters are stored in the following variables: + <ul> + <li>Parameters - string containing the parameters as a single variable</li> + <li>bsh.args - String array containing parameters, split on white-space</li> + </ul></property> + <property name="Script file" required="No">A file containing the BeanShell script to run.</property> + <property name="Script" required="Yes (unless script file is provided)">The BeanShell script to run. + The return value (if not null) is stored as the sampler result.</property> </properties> <p> N.B. Each Sampler instance has its own BeanShell interpeter, @@ -825,19 +831,12 @@ <p> Before invoking the script, some variables are set up: </p> -<p> -The contents of the Parameters field is put into the variable "Parameters". -The string is also split into separate tokens using a single space as the separator, and the resulting list -is stored in the String array args. -</p> -<p> -The full list of variables that is set up is as follows:</p> <ul> <li>log - the Logger</li> <li>Label - the Sampler label</li> <li>FileName - the file name, if any</li> <li>Parameters - text from the Parameters field</li> -<li>args - the parameters, split as described above</li> +<li>bsh.args - the parameters, split as described above</li> <li>SampleResult - pointer to the current SampleResult</li> <li>ctx - JMeterContext</li> <li>vars - JMeterVariables - e.g. vars.get("VAR1"); vars.put("VAR2","value"); vars.remove("VAR3");</li> @@ -1942,7 +1941,7 @@ </properties> </component> -<component name="BeanShell Listener" index="§-num;.3.14" width="768" height="230" screenshot="beanshell_listener.png"> +<component name="BeanShell Listener" index="§-num;.3.14" width="516" height="286" screenshot="beanshell_listener.png"> <description> <p> The BeanShell Listener allows the use of BeanShell for processing samples for saving etc. @@ -1959,9 +1958,17 @@ </p> </description> <properties> - <property name="Name" required="">Descriptive name for this element that is shown in the tree.</property> - <property name="Script" required="Yes">The BeanShell script. The return value is ignored. See below for variables defined to the script.</property> + <property name="Name" required="">Descriptive name for this element that is shown in the tree.</property> + <property name="Parameters" required="No">Parameters to pass to the BeanShell script. + The parameters are stored in the following variables: + <ul> + <li>Parameters - string containing the parameters as a single variable</li> + <li>bsh.args - String array containing parameters, split on white-space</li> + </ul></property> + <property name="Script file" required="No">A file containing the BeanShell script to run</property> + <property name="Script" required="Yes (unless script file is provided)">The BeanShell script to run. The return value is ignored.</property> </properties> +<p>The following variables are set up for use by the script:</p> <ul> <li>log - (Logger) - can be used to write to the log file</li> <li>ctx - (JMeterContext) - gives access to the context</li> @@ -2667,15 +2674,15 @@ </description> <properties> -<property name="Name" required="">Descriptive name for this element that is shown in the tree.</property> -<property name="Parameters" required="No">Parameters to pass to the BeanShell script. + <property name="Name" required="">Descriptive name for this element that is shown in the tree.</property> + <property name="Parameters" required="No">Parameters to pass to the BeanShell script. The parameters are stored in the following variables: <ul> <li>Parameters - string containing the parameters as a single variable</li> <li>bsh.args - String array containing parameters, split on white-space</li> </ul></property> -<property name="Script file" required="No">A file containing the BeanShell script to run</property> -<property name="Script" required="No">The BeanShell script to run</property> + <property name="Script file" required="No">A file containing the BeanShell script to run. This overrides the script.</property> + <property name="Script" required="Yes (unless script file is provided)">The BeanShell script to run. The return value is ignored.</property> </properties> <p>There's a <a href="../demos/BeanShellAssertion.bsh">sample script</a> you can try.</p> <p>The following variables are defined to the script. @@ -2880,7 +2887,7 @@ </component> -<component name="BeanShell Timer" index="§-num;.6.6" width="459" height="238" screenshot="timers/beanshell_timer.png"> +<component name="BeanShell Timer" index="§-num;.6.6" width="516" height="286" screenshot="timers/beanshell_timer.png"> <description> <p> The BeanShell Timer can be used to generate a delay. @@ -2897,11 +2904,23 @@ </p> </description> <properties> - <property name="Name" required="">Descriptive name for this element that is shown in the tree.</property> - <property name="Script" required="Yes"> + <property name="Name" required="No">Descriptive name for this element that is shown in the tree.</property> + <property name="Parameters" required="No">Parameters to pass to the BeanShell script. + The parameters are stored in the following variables: + <ul> + <li>Parameters - string containing the parameters as a single variable</li> + <li>bsh.args - String array containing parameters, split on white-space</li> + </ul> + </property> + <property name="Script file" required="No"> + A file containing the BeanShell script to run. + The return value is used as the number of milliseconds to wait. + </property> + <property name="Script" required="Yes (unless script file is provided)"> The BeanShell script. The return value is used as the number of milliseconds to wait. - </property> + </property> </properties> +<p>The following variables are set up for use by the script:</p> <ul> <li>log - (Logger) - can be used to write to the log file</li> <li>ctx - (JMeterContext) - gives access to the context</li> @@ -3102,7 +3121,7 @@ </properties> </component> -<component name="BeanShell PreProcessor" index="§-num;.7.7" width="461" height="188" screenshot="beanshell_preprocessor.png"> +<component name="BeanShell PreProcessor" index="§-num;.7.7" width="516" height="286" screenshot="beanshell_preprocessor.png"> <description> <p> The BeanShell PreProcessor allows arbitrary code to be applied before taking a sample. @@ -3120,9 +3139,17 @@ </p> </description> <properties> - <property name="Name" required="">Descriptive name for this element that is shown in the tree.</property> - <property name="Script" required="Yes">The BeanShell script. The return value is ignored. See below for variables defined to the script.</property> + <property name="Name" required="No">Descriptive name for this element that is shown in the tree.</property> + <property name="Parameters" required="No">Parameters to pass to the BeanShell script. + The parameters are stored in the following variables: + <ul> + <li>Parameters - string containing the parameters as a single variable</li> + <li>bsh.args - String array containing parameters, split on white-space</li> + </ul></property> + <property name="Script file" required="No">A file containing the BeanShell script to run.</property> + <property name="Script" required="Yes (unless script file is provided)">The BeanShell script. The return value is ignored.</property> </properties> +<p>The following variables are set up for use by the script:</p> <ul> <li>log - (Logger) - can be used to write to the log file</li> <li>ctx - (JMeterContext) - gives access to the context</li> @@ -3311,7 +3338,7 @@ </properties> </component> -<component name="BeanShell PostProcessor" index="§-num;.8.6" width="461" height="188" screenshot="beanshell_postprocessor.png"> +<component name="BeanShell PostProcessor" index="§-num;.8.6" width="516" height="286" screenshot="beanshell_postprocessor.png"> <description> <p> The BeanShell PreProcessor allows arbitrary code to be applied after taking a sample. @@ -3328,9 +3355,17 @@ </p> </description> <properties> - <property name="Name" required="">Descriptive name for this element that is shown in the tree.</property> - <property name="Script" required="Yes">The BeanShell script. The return value is ignored. See below for variables defined to the script.</property> + <property name="Name" required="No">Descriptive name for this element that is shown in the tree.</property> + <property name="Parameters" required="No">Parameters to pass to the BeanShell script. + The parameters are stored in the following variables: + <ul> + <li>Parameters - string containing the parameters as a single variable</li> + <li>bsh.args - String array containing parameters, split on white-space</li> + </ul></property> + <property name="Script file" required="No">A file containing the BeanShell script to run.</property> + <property name="Script" required="Yes (unless script file is provided)">The BeanShell script. The return value is ignored.</property> </properties> +<p>The following variables are set up for use by the script:</p> <ul> <li>log - (Logger) - can be used to write to the log file</li> <li>ctx - (JMeterContext) - gives access to the context</li> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]