You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2006/03/23 20:45:47 UTC

svn commit: r388244 - in /jakarta/jmeter/branches/rel-2-1: test/src/org/apache/jmeter/functions/PackageTest.java xdocs/images/screenshots/beanshell_listener.png xdocs/usermanual/component_reference.xml

Author: sebb
Date: Thu Mar 23 11:45:46 2006
New Revision: 388244

URL: http://svn.apache.org/viewcvs?rev=388244&view=rev
Log:
Add BeanShell Listener docs; update HTTP re login forms

Added:
    jakarta/jmeter/branches/rel-2-1/xdocs/images/screenshots/beanshell_listener.png   (with props)
Modified:
    jakarta/jmeter/branches/rel-2-1/test/src/org/apache/jmeter/functions/PackageTest.java
    jakarta/jmeter/branches/rel-2-1/xdocs/usermanual/component_reference.xml

Modified: jakarta/jmeter/branches/rel-2-1/test/src/org/apache/jmeter/functions/PackageTest.java
URL: http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/test/src/org/apache/jmeter/functions/PackageTest.java?rev=388244&r1=388243&r2=388244&view=diff
==============================================================================
--- jakarta/jmeter/branches/rel-2-1/test/src/org/apache/jmeter/functions/PackageTest.java (original)
+++ jakarta/jmeter/branches/rel-2-1/test/src/org/apache/jmeter/functions/PackageTest.java Thu Mar 23 11:45:46 2006
@@ -324,7 +324,16 @@
 		assertEquals("a", vars.get("VAR_1"));
 		assertEquals("?", vars.get("VAR_2"));
 		assertEquals("c", vars.get("VAR_3"));
-        assertNull(vars.get("VAR3_4"));
+        assertNull(vars.get("VAR_4"));
+
+		src = "a,b";
+		vars.put("VAR", src);
+		split = SplitParams("${VAR}", "VAR", null);
+		assertEquals(src, split.execute());
+		assertEquals("2", vars.get("VAR_n"));
+		assertEquals("a", vars.get("VAR_1"));
+		assertEquals("b", vars.get("VAR_2"));
+        assertNull(vars.get("VAR_3"));
 
         src = "a,,c,";
         vars.put("VAR", src);
@@ -796,6 +805,7 @@
         Random r = new Random();
         Collection parms = MakeParams("0","10000000000","VAR");
         r.setParameters(parms);
-        String s = r.execute(null,null);
+        //String s = 
+        	r.execute(null,null);
     }
 }

Added: jakarta/jmeter/branches/rel-2-1/xdocs/images/screenshots/beanshell_listener.png
URL: http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/xdocs/images/screenshots/beanshell_listener.png?rev=388244&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jakarta/jmeter/branches/rel-2-1/xdocs/images/screenshots/beanshell_listener.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: jakarta/jmeter/branches/rel-2-1/xdocs/usermanual/component_reference.xml
URL: http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/xdocs/usermanual/component_reference.xml?rev=388244&r1=388243&r2=388244&view=diff
==============================================================================
--- jakarta/jmeter/branches/rel-2-1/xdocs/usermanual/component_reference.xml (original)
+++ jakarta/jmeter/branches/rel-2-1/xdocs/usermanual/component_reference.xml Thu Mar 23 11:45:46 2006
@@ -83,9 +83,14 @@
         <p>There are two versions of the sampler
          - one uses the default Java HTTP implementation, the other uses Commons HttpClient</p>
          
-        <p>If the request requires a login authorization, you will also have to add an
-        <complink name="HTTP Authorization Manager"/>
-        Configuration Element. And, if the request uses cookies, then you will also need an
+        <p>If the request requires server or proxy login authorization (i.e. where a browser would create a pop-up dialog box),
+         you will also have to add an <complink name="HTTP Authorization Manager"/> Configuration Element.
+         For normal logins (i.e. where the user enters login information in a form), you will need to work out what the form submit button does,
+         and create an HTTP request with the appropriate method (usually POST) 
+         and the appropriate parameters from the form definition. 
+         If the page uses HTTP, you can use the JMeter Proxy to capture the login sequence.
+        </p>
+        <p>If the request uses cookies, then you will also need an
         <complink name="HTTP Cookie Manager"/>.  You can
         add either of these elements to the Thread Group or the HTTP Request.  If you have
         more than one HTTP Request that needs authorizations or cookies, then add the
@@ -1579,6 +1584,27 @@
 </properties>
 </component>
 
+<component index="&sect-num;.3.14" name="BeanShell Listener"  screenshot="beanshell_listener.png">
+<description>
+<p>
+The BeanShell Listener allows the use of BeanShell for processing samples for saving etc.
+</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>
+</properties>
+<ul>
+<li>log - (Logger) - can be used to write to the log file</li>
+<li>ctx - (JMeterContext) - gives access to the context</li>
+<li>vars - (JMeterVariables) - gives read/write access to variables: vars.get(key); vars.put(key,val)</li>
+<li>sampleResult - (SampleResult) - gives access to the previous SampleResult</li>
+<li>sampleEvent (SampleEvent) gives access to the current sample event</li>
+</ul>
+<p>For details of all the methods available on each of the above variables, please check the Javadoc</p>
+<p>If the property <b>beanshell.listener.init</b> is defined, this is used to load an initialisation file, which can be used to define methods etc for use in the BeanShell script.</p>
+</component>
+
 </section>
 
 <section name="&sect-num;.4 Configuration Elements" anchor="config_elements">
@@ -2355,7 +2381,7 @@
 <li>vars - (JMeterVariables) - gives read/write access to variables: vars.get(key); vars.put(key,val)</li>
 </ul>
 <p>For details of all the methods available on each of the above variables, please check the Javadoc</p>
-<p>If the property <b>beanshell.timer.init</b> is defined, this is used to load an initialisation file.</p>
+<p>If the property <b>beanshell.timer.init</b> is defined, this is used to load an initialisation file, which can be used to define methods etc for use in the BeanShell script.</p>
 </component>
 
 </section>
@@ -2551,7 +2577,7 @@
 <li>sampler - (Sampler)- gives access to the current sampler</li>
 </ul>
 <p>For details of all the methods available on each of the above variables, please check the Javadoc</p>
-<p>If the property <b>beanshell.preprocessor.init</b> is defined, this is used to load an initialisation file.</p>
+<p>If the property <b>beanshell.preprocessor.init</b> is defined, this is used to load an initialisation file, which can be used to define methods etc for use in the BeanShell script.</p>
 </component>
 
 </section>
@@ -2711,7 +2737,7 @@
 <li>data - (byte [])- gives access to the current sample data</li>
 </ul>
 <p>For details of all the methods available on each of the above variables, please check the Javadoc</p>
-<p>If the property <b>beanshell.postprocessor.init</b> is defined, this is used to load an initialisation file.</p>
+<p>If the property <b>beanshell.postprocessor.init</b> is defined, this is used to load an initialisation file, which can be used to define methods etc for use in the BeanShell script.</p>
 </component>
 
 </section>



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org