Author: sebb
Date: Sat Jan 30 23:15:28 2010
New Revision: 904916

URL: http://svn.apache.org/viewvc?rev=904916&view=rev
Log:
Bug 48511 - add parent,child,all selection to regex extractor panel

Added:
    
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractScopedTestElement.java
   (with props)
Modified:
    jakarta/jmeter/trunk/docs/images/screenshots/regex_extractor.png
    
jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java
    
jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/RegexExtractorGui.java
    
jakarta/jmeter/trunk/src/core/org/apache/jmeter/processor/gui/AbstractPostProcessorGui.java
    
jakarta/jmeter/trunk/test/src/org/apache/jmeter/extractor/TestRegexExtractor.java
    jakarta/jmeter/trunk/xdocs/changes.xml
    jakarta/jmeter/trunk/xdocs/images/screenshots/regex_extractor.png
    jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml

Modified: jakarta/jmeter/trunk/docs/images/screenshots/regex_extractor.png
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/docs/images/screenshots/regex_extractor.png?rev=904916&r1=904915&r2=904916&view=diff
==============================================================================
Binary files - no diff available.

Modified: 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java?rev=904916&r1=904915&r2=904916&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java
 (original)
+++ 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java
 Sat Jan 30 23:15:28 2010
@@ -27,7 +27,7 @@
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.jmeter.processor.PostProcessor;
 import org.apache.jmeter.samplers.SampleResult;
-import org.apache.jmeter.testelement.AbstractTestElement;
+import org.apache.jmeter.testelement.AbstractScopedTestElement;
 import org.apache.jmeter.testelement.property.IntegerProperty;
 import org.apache.jmeter.threads.JMeterContext;
 import org.apache.jmeter.threads.JMeterVariables;
@@ -45,7 +45,7 @@
 
 // @see org.apache.jmeter.extractor.TestRegexExtractor for unit tests
 
-public class RegexExtractor extends AbstractTestElement implements 
PostProcessor, Serializable {
+public class RegexExtractor extends AbstractScopedTestElement implements 
PostProcessor, Serializable {
 
 
     private static final Logger log = LoggingManager.getLoggerForClass();
@@ -110,38 +110,10 @@
             vars.put(refName, defaultValue);
         }
 
-        Perl5Matcher matcher = JMeterUtils.getMatcher();
-        String inputString =
-              useUrl() ? previousResult.getUrlAsString() // Bug 39707
-            : useHeaders() ? previousResult.getResponseHeaders()
-            : useCode() ? previousResult.getResponseCode() //Bug 43451
-            : useMessage() ? previousResult.getResponseMessage() //Bug 43451
-            : useUnescapedBody() ? 
StringEscapeUtils.unescapeHtml(previousResult.getResponseDataAsString())
-            : previousResult.getResponseDataAsString() // Bug 36898
-            ;
-           if (log.isDebugEnabled()) {
-               log.debug("Input = " + inputString);
-           }
-        PatternMatcherInput input = new PatternMatcherInput(inputString);
-           String regex = getRegex();
-        if (log.isDebugEnabled()) {
-            log.debug("Regex = " + regex);
-           }
-        try {
-            Pattern pattern = JMeterUtils.getPatternCache().getPattern(regex, 
Perl5Compiler.READ_ONLY_MASK);
-            List<MatchResult> matches = new ArrayList<MatchResult>();
-            int x = 0;
-            boolean done = false;
-            do {
-                if (matcher.contains(input, pattern)) {
-                    log.debug("RegexExtractor: Match found!");
-                    matches.add(matcher.getMatch());
-                } else {
-                    done = true;
-                }
-                x++;
-            } while (x != matchNumber && !done);
 
+        String regex = getRegex();
+        try {
+            List<MatchResult> matches = processMatches(regex, previousResult, 
matchNumber);
             int prevCount = 0;
             String prevString = vars.get(refName + REF_MATCH_NR);
             if (prevString != null) {
@@ -192,6 +164,61 @@
         }
     }
 
+    private String getInputString(SampleResult result) {
+        String inputString = useUrl() ? result.getUrlAsString() // Bug 39707
+                : useHeaders() ? result.getResponseHeaders()
+                : useCode() ? result.getResponseCode() // Bug 43451
+                : useMessage() ? result.getResponseMessage() // Bug 43451
+                : useUnescapedBody() ? 
StringEscapeUtils.unescapeHtml(result.getResponseDataAsString())
+                : result.getResponseDataAsString() // Bug 36898
+                ;
+       if (log.isDebugEnabled()) {
+           log.debug("Input = " + inputString);
+       }
+       return inputString;
+    }
+    
+    private List<MatchResult> processMatches(String regex, SampleResult 
result, int matchNumber) {
+        List<SampleResult> sampleList = new ArrayList<SampleResult>();
+
+        String scope = fetchScope();
+        if (isScopeParent(scope) || isScopeAll(scope)) {
+            sampleList.add(result);
+        }
+        if (isScopeChildren(scope) || isScopeAll(scope)) {
+            for (SampleResult subResult : result.getSubResults()) {
+                sampleList.add(subResult);
+            }
+        }
+
+        if (log.isDebugEnabled()) {
+            log.debug("Regex = " + regex);
+        }
+
+        Perl5Matcher matcher = JMeterUtils.getMatcher();
+        Pattern pattern = JMeterUtils.getPatternCache().getPattern(regex, 
Perl5Compiler.READ_ONLY_MASK);
+        List<MatchResult> matches = new ArrayList<MatchResult>();
+        int found = 0;
+
+        for (SampleResult sr : sampleList) {
+            String inputString = getInputString(sr);
+            PatternMatcherInput input = new PatternMatcherInput(inputString);
+            while (matchNumber <=0 || found != matchNumber) {
+                if (matcher.contains(input, pattern)) {
+                    log.debug("RegexExtractor: Match found!");
+                    matches.add(matcher.getMatch());
+                    found++;
+                } else {
+                    break;
+                }
+            }
+            if (matchNumber > 0 && found == matchNumber){// no need to process 
further
+                break;
+            }
+        }
+        return matches;
+    }
+
     /**
      * Creates the variables:<br/>
      * basename_gn, where n=0...# of groups<br/>
@@ -262,7 +289,7 @@
         StringBuilder result = new StringBuilder();
         for (int a = 0; a < template.length; a++) {
             if (log.isDebugEnabled()) {
-                log.debug("RegexExtractor: Template piece #" + a + " = " + 
template[a]);
+                log.debug("RegexExtractor: Template piece #" + a + " = " + 
template[a] + " " +template[a].getClass().getSimpleName());
             }
             if (template[a] instanceof String) {
                 result.append(template[a]);
@@ -289,7 +316,7 @@
                 , Perl5Compiler.READ_ONLY_MASK
                 & Perl5Compiler.SINGLELINE_MASK);
         if (log.isDebugEnabled()) {
-            log.debug("Pattern = " + templatePattern);
+            log.debug("Pattern = " + templatePattern.getPattern());
             log.debug("template = " + rawTemplate);
         }
         Util.split(pieces, matcher, templatePattern, rawTemplate);
@@ -299,18 +326,26 @@
             log.debug("template split into " + pieces.size() + " pieces, 
starts with = " + startsWith);
         }
         if (startsWith) {
-            pieces.remove(0);// Remove initial empty entry
+            String dropped = pieces.remove(0);// Remove initial empty entry
+            if (log.isDebugEnabled()) {
+                log.debug("Dropped leading: '"+dropped+"'");
+            }            
         }
         Iterator<String> iter = pieces.iterator();
         while (iter.hasNext()) {
+            final String next = iter.next();
             boolean matchExists = matcher.contains(input, templatePattern);
             if (startsWith) {
                 if (matchExists) {
                     combined.add(new Integer(matcher.getMatch().group(1)));
                 }
-                combined.add(iter.next());
+                if (next.length() > 0) {
+                    combined.add(next);
+                }
             } else {
-                combined.add(iter.next());
+                if (next.length() > 0) {
+                    combined.add(next);
+                }
                 if (matchExists) {
                     combined.add(new Integer(matcher.getMatch().group(1)));
                 }

Modified: 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/RegexExtractorGui.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/RegexExtractorGui.java?rev=904916&r1=904915&r2=904916&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/RegexExtractorGui.java
 (original)
+++ 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/RegexExtractorGui.java
 Sat Jan 30 23:15:28 2010
@@ -78,6 +78,7 @@
         super.configure(el);
         if (el instanceof RegexExtractor){
             RegexExtractor re = (RegexExtractor) el;
+            showScopeSettings(re);
             useHeaders.setSelected(re.useHeaders());
             useBody.setSelected(re.useBody());
             useUnescapedBody.setSelected(re.useUnescapedBody());
@@ -110,6 +111,7 @@
         super.configureTestElement(extractor);
         if (extractor instanceof RegexExtractor) {
             RegexExtractor regex = (RegexExtractor) extractor;
+            saveScopeSettings(regex);
             regex.setUseField(group.getSelection().getActionCommand());
             regex.setRefName(refNameField.getText());
             regex.setRegex(regexField.getText());
@@ -141,6 +143,7 @@
 
         Box box = Box.createVerticalBox();
         box.add(makeTitlePanel());
+        box.add(createScopePanel());
         box.add(makeSourcePanel());
         add(box, BorderLayout.NORTH);
         add(makeParameterPanel(), BorderLayout.CENTER);

Modified: 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/processor/gui/AbstractPostProcessorGui.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/processor/gui/AbstractPostProcessorGui.java?rev=904916&r1=904915&r2=904916&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/processor/gui/AbstractPostProcessorGui.java
 (original)
+++ 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/processor/gui/AbstractPostProcessorGui.java
 Sat Jan 30 23:15:28 2010
@@ -21,15 +21,27 @@
 import java.util.Arrays;
 import java.util.Collection;
 
+import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
 
 import org.apache.jmeter.gui.AbstractJMeterGuiComponent;
 import org.apache.jmeter.gui.util.MenuFactory;
+import org.apache.jmeter.testelement.AbstractScopedTestElement;
+import org.apache.jmeter.util.ScopePanel;
 
 /**
- * @version $Revision$
+ * This is the base class for JMeter GUI components which manage 
PostProcessors.
+ * 
+ * PostProcessors which can be applied to different scopes (parent, children 
or both)
+ * need to use the createScopePanel() to add the panel to the GUI, and they 
also
+ * need to use saveScopeSettings() and showScopeSettings() to keep the test 
element
+ * and GUI in synch.
+ *
  */
 public abstract class AbstractPostProcessorGui extends 
AbstractJMeterGuiComponent {
+
+    private ScopePanel scopePanel;
+
     public JPopupMenu createPopupMenu() {
         return MenuFactory.getDefaultExtractorMenu();
     }
@@ -37,4 +49,56 @@
     public Collection<String> getMenuCategories() {
         return Arrays.asList(new String[] { MenuFactory.POST_PROCESSORS });
     }
+    /**
+     * Create the scope settings panel.
+     * GUIs that want to add the panel need to add the following to the init 
method:
+     * <br/>
+     * box.add(createScopePanel());
+     * @return the scope settings panel
+     */
+    protected JPanel createScopePanel(){
+        scopePanel = new ScopePanel();
+        return scopePanel;
+    }
+
+    @Override
+    public void clearGui(){
+        super.clearGui();
+        if (scopePanel != null) {
+            scopePanel.clearGui();
+        }
+    }
+
+    /**
+     * Save the scope settings in the test element.
+     * Needs to be called by the GUIs modifyTestElement method.
+     * @param testElement
+     */
+    protected void saveScopeSettings(AbstractScopedTestElement testElement) {
+        if (scopePanel.isScopeParent()){
+            testElement.setScopeParent();
+        } else
+        if (scopePanel.isScopeChildren()){
+            testElement.setScopeChildren();
+        } else {
+            testElement.setScopeAll();
+        }
+        
+    }
+
+    /**
+     * Show the scope settings from the test element.
+     * Needs to be called by the GUIs configure method.     * 
+     * @param testElement
+     */
+    protected void showScopeSettings(AbstractScopedTestElement testElement) {
+        String scope = testElement.fetchScope();
+        if (testElement.isScopeParent(scope)) {
+                scopePanel.setScopeParent();                
+        } else if (testElement.isScopeChildren(scope)){
+            scopePanel.setScopeChildren();
+        } else {
+            scopePanel.setScopeAll();
+        }
+    }
 }

Added: 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractScopedTestElement.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractScopedTestElement.java?rev=904916&view=auto
==============================================================================
--- 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractScopedTestElement.java
 (added)
+++ 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractScopedTestElement.java
 Sat Jan 30 23:15:28 2010
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+
+package org.apache.jmeter.testelement;
+
+/**
+ * <p>
+ * Super-class for all TestElements that can be applied to main sample, 
sub-samples or both.
+ * Test elements can use the 
+ * </p>
+ * 
+ * <p>
+ * Their corresponding GUI classes need to add the ScopePanel to the GUI
+ * using the AbstractXXXGui methods:
+ * <ul>
+ * <li>createScopePanel()</li>
+ * <li>saveScopeSettings()</li>
+ * <li>showScopeSettings()</li>
+ * </ul>
+ * </p>
+ */
+public abstract class AbstractScopedTestElement extends AbstractTestElement {
+
+    private static final String SCOPE = "Sample.scope";
+    private static final String SCOPE_PARENT = "parent";
+    private static final String SCOPE_CHILDREN = "children";
+    private static final String SCOPE_ALL = "all";
+
+    /**
+     * Get the scope setting
+     * @return the scope, default parent
+     */
+    public String fetchScope() {
+        return getPropertyAsString(SCOPE, SCOPE_PARENT);
+    }
+
+    /**
+     * Is the assertion to be applied to the main (parent) sample?
+     * 
+     * @param scope
+     * @return if the assertion is to be applied to the parent sample.
+     */
+    public boolean isScopeParent(String scope) {
+        return scope.equals(SCOPE_PARENT);
+    }
+
+    /**
+     * Is the assertion to be applied to the sub-samples (children)?
+     * 
+     * @param scope
+     * @return if the assertion is to be applied to the children.
+     */
+    public boolean isScopeChildren(String scope) {
+        return scope.equals(SCOPE_CHILDREN);
+    }
+
+    /**
+     * Is the assertion to be applied to the all samples?
+     * 
+     * @param scope
+     * @return if the assertion is to be applied to the all samples.
+     */
+    protected boolean isScopeAll(String scope) {
+        return scope.equals(SCOPE_ALL);
+    }
+
+    public void setScopeParent() {
+        removeProperty(SCOPE);
+    }
+
+    public void setScopeChildren() {
+        setProperty(SCOPE, SCOPE_CHILDREN);
+    }
+
+    public void setScopeAll() {
+        setProperty(SCOPE, SCOPE_ALL);
+    }
+}

Propchange: 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractScopedTestElement.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractScopedTestElement.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/extractor/TestRegexExtractor.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/extractor/TestRegexExtractor.java?rev=904916&r1=904915&r2=904916&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/extractor/TestRegexExtractor.java
 (original)
+++ 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/extractor/TestRegexExtractor.java
 Sat Jan 30 23:15:28 2010
@@ -320,4 +320,93 @@
             assertNull(vars.get("regVal_g"));
         }
 
+    public void testScope1() throws Exception {
+        result.setResponseData("<title>ONE</title>", "ISO-8859-1");
+        extractor.setScopeParent();
+        extractor.setTemplate("$1$");
+        extractor.setMatchNumber(1);
+        extractor.setRegex("<title>([^<]+)<");
+        extractor.setDefaultValue("NOTFOUND");
+        extractor.process();
+        assertEquals("ONE", vars.get("regVal"));
+        extractor.setScopeAll();
+        extractor.process();
+        assertEquals("ONE", vars.get("regVal"));
+        extractor.setScopeChildren();
+        extractor.process();
+        assertEquals("NOTFOUND", vars.get("regVal"));
+    }
+
+    public void testScope2() throws Exception {
+        result.sampleStart();
+        result.setResponseData("<title>PARENT</title>", "ISO-8859-1");
+        result.sampleEnd();
+        SampleResult child1 = new SampleResult();
+        child1.sampleStart();
+        child1.setResponseData("<title>ONE</title>", "ISO-8859-1");
+        child1.sampleEnd();
+        result.addSubResult(child1);
+        SampleResult child2 = new SampleResult();
+        child2.sampleStart();
+        child2.setResponseData("<title>TWO</title>", "ISO-8859-1");
+        child2.sampleEnd();
+        result.addSubResult(child2);
+        SampleResult child3 = new SampleResult();
+        child3.sampleStart();
+        child3.setResponseData("<title>THREE</title>", "ISO-8859-1");
+        child3.sampleEnd();
+        result.addSubResult(child3);
+        extractor.setScopeParent();
+        extractor.setTemplate("$1$");
+        extractor.setMatchNumber(1);
+        extractor.setRegex("<title>([^<]+)<");
+        extractor.setDefaultValue("NOTFOUND");
+        extractor.process();
+        assertEquals("PARENT", vars.get("regVal"));
+        extractor.setScopeAll();
+        extractor.setMatchNumber(3);
+        extractor.process();
+        assertEquals("TWO", vars.get("regVal"));
+        extractor.setScopeChildren();
+        extractor.process();
+        assertEquals("THREE", vars.get("regVal"));
+        extractor.setRegex(">(...)<");
+        extractor.setScopeAll();
+        extractor.setMatchNumber(2);
+        extractor.process();
+        assertEquals("TWO", vars.get("regVal"));
+
+        // Match all
+        extractor.setRegex("<title>([^<]+)<");
+        extractor.setMatchNumber(-1);
+
+        extractor.setScopeParent();
+        extractor.process();
+        assertEquals("1", vars.get("regVal_matchNr"));
+        extractor.setScopeAll();
+        extractor.process();
+        assertEquals("4", vars.get("regVal_matchNr"));
+        extractor.setScopeChildren();
+        extractor.process();
+        assertEquals("3", vars.get("regVal_matchNr"));
+
+        // Check random number
+        extractor.setMatchNumber(0);
+        extractor.setScopeParent();
+        extractor.process();
+        assertEquals("PARENT", vars.get("regVal"));
+        extractor.setRegex("(<title>)");
+        extractor.setScopeAll();
+        extractor.process();
+        assertEquals("<title>", vars.get("regVal"));
+        extractor.setScopeChildren();
+        extractor.process();
+        assertEquals("<title>", vars.get("regVal"));
+        extractor.setRegex("<title>(...)<");
+        extractor.setScopeAll();
+        extractor.process();
+        final String found = vars.get("regVal");
+        assertTrue(found.equals("ONE") || found.equals("TWO"));
+    }
+
 }

Modified: jakarta/jmeter/trunk/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=904916&r1=904915&r2=904916&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/changes.xml (original)
+++ jakarta/jmeter/trunk/xdocs/changes.xml Sat Jan 30 23:15:28 2010
@@ -178,6 +178,7 @@
 <li>Added JSR223 Assertion</li>
 <li>Added BSF Timer and JSR223 Timer</li>
 <li>Bug 48331 - XpathExtractor does not return XML string representations for 
a Nodeset</li>
+<li>Bug 48511 - add parent,child,all selection to regex extractor panel</li>
 </ul>
 
 <h3>Functions</h3>

Modified: jakarta/jmeter/trunk/xdocs/images/screenshots/regex_extractor.png
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/images/screenshots/regex_extractor.png?rev=904916&r1=904915&r2=904916&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=904916&r1=904915&r2=904916&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
+++ jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml Sat Jan 30 
23:15:28 2010
@@ -639,14 +639,14 @@
                                           <property name="root DN" 
required="Yes">DN for the server to communicate</property>
                                           <property name="Username" 
required="Usually">LDAP server username.</property>
                                           <property name="Password" 
required="Usually">LDAP server password.</property>
-                                          <property name="Entry DN" 
required="yes">the name of the context to create or Modify; may not be empty 
Example: do you want to add cn=apache,ou=test
+                                          <property name="Entry DN" 
required="Yes">the name of the context to create or Modify; may not be empty 
Example: do you want to add cn=apache,ou=test
                                             you have to add in table name=cn, 
value=apache
                                           </property>
-                                          <property name="Delete" 
required="yes">the name of the context to Delete; may not be empty</property>
-                                          <property name="Search base" 
required="yes">the name of the context or object to search</property>
-                                          <property name="Search filter" 
required="yes"> the filter expression to use for the search; may not be 
null</property>
-                                          <property name="add test" 
required="yes"> this name, value pair to added in the given context 
object</property>
-                                          <property name="modify test" 
required="yes"> this name, value pair to add or modify in the given context 
object</property>
+                                          <property name="Delete" 
required="Yes">the name of the context to Delete; may not be empty</property>
+                                          <property name="Search base" 
required="Yes">the name of the context or object to search</property>
+                                          <property name="Search filter" 
required="Yes"> the filter expression to use for the search; may not be 
null</property>
+                                          <property name="add test" 
required="Yes"> this name, value pair to added in the given context 
object</property>
+                                          <property name="modify test" 
required="Yes"> this name, value pair to add or modify in the given context 
object</property>
                                       </properties>
 
                                       <links>
@@ -4013,13 +4013,29 @@
        after all Assertions have been run.
        </p>
        </description>
-<component name="Regular Expression Extractor" index="&sect-num;.8.1"  
width="618" height="256" screenshot="regex_extractor.png">
+<component name="Regular Expression Extractor" index="&sect-num;.8.1"  
width="626" height="297" screenshot="regex_extractor.png">
 <description><p>Allows the user to extract values from a server response using 
a Perl-type regular expression.  As a post-processor,
 this element will execute after each Sample request in its scope, applying the 
regular expression, extracting the requested values,
 generate the template string, and store the result into the given variable 
name.</p></description>
 <properties>
         <property name="Name" required="">Descriptive name for this element 
that is shown in the tree.</property>
-        <property name="Response Field to check" required="yes">
+        <property name="Which samples to process" required="Yes">
+        This is for use with samplers that can generate sub-samples, 
+        e.g. HTTP Sampler with embedded resources, Mail Reader or samples 
generated by the Transaction Controller.
+        <ul>
+        <li>Main sample only - only applies to the main sample</li>
+        <li>Sub-samples only - only applies to the sub-samples</li>
+        <li>Main sample and sub-samples - applies to both.</li>
+        </ul>
+        Matching is applied to all qualifying samples in turn.
+        For example if there is a main sample and 3 sub-samples, each of which 
contains a single match for the regex,
+        (i.e. 4 matches in total).
+        For match number = 3, Sub-samples only, the extractor will match the 
3rd sub-sample.
+        For match number = 3, Main sample and sub-samples, the extractor will 
match the 2nd sub-sample (1st match is main sample).
+        For match number = 0 or negative, all qualifying samples will be 
processed.
+        For match number > 0, matching will stop as soon as enough matches 
have been found.
+        </property>
+        <property name="Response Field to check" required="Yes">
         The following response fields can be checked:
         <ul>
         <li>Body - the body of the response, e.g. the content of a web-page 
(excluding headers)</li>



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

Reply via email to