jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philippe Mouawad <philippe.moua...@gmail.com>
Subject Re: svn commit: r1614883 - in /jmeter/trunk: src/components/org/apache/jmeter/extractor/ src/components/org/apache/jmeter/extractor/gui/ src/core/org/apache/jmeter/resources/ xdocs/ xdocs/usermanual/
Date Fri, 15 Aug 2014 12:57:57 GMT
Hello,
Shouldn't this be an enhancement rather than bug fix ?
Also note in changes.xml does not contain the usual "Contributed by ..."

Regards
Philippe

On Thursday, July 31, 2014, <sebb@apache.org> wrote:

> Author: sebb
> Date: Thu Jul 31 13:28:20 2014
> New Revision: 1614883
>
> URL: http://svn.apache.org/r1614883
> Log:
> Allow access to Request Headers in Regex Extractor
> Bugzilla Id: 52061
>
> Modified:
>
> jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java
>
> jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/RegexExtractorGui.java
>     jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
>
> jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
>     jmeter/trunk/xdocs/changes.xml
>     jmeter/trunk/xdocs/usermanual/component_reference.xml
>
> Modified:
> jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java
> URL:
> http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java?rev=1614883&r1=1614882&r2=1614883&view=diff
>
> ==============================================================================
> ---
> jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java
> (original)
> +++
> jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java
> Thu Jul 31 13:28:20 2014
> @@ -62,6 +62,7 @@ public class RegexExtractor extends Abst
>       *  Do not change these values!
>      */
>      public static final String USE_HDRS = "true"; // $NON-NLS-1$
> +    public static final String USE_REQUEST_HDRS = "request_headers"; //
> $NON-NLS-1$
>      public static final String USE_BODY = "false"; // $NON-NLS-1$
>      public static final String USE_BODY_UNESCAPED = "unescaped"; //
> $NON-NLS-1$
>      public static final String USE_BODY_AS_DOCUMENT = "as_document"; //
> $NON-NLS-1$
> @@ -172,6 +173,7 @@ public class RegexExtractor extends Abst
>      private String getInputString(SampleResult result) {
>          String inputString = useUrl() ? result.getUrlAsString() // Bug
> 39707
>                  : useHeaders() ? result.getResponseHeaders()
> +                : useRequestHeaders() ? result.getRequestHeaders()
>                  : useCode() ? result.getResponseCode() // Bug 43451
>                  : useMessage() ? result.getResponseMessage() // Bug 43451
>                  : useUnescapedBody() ?
> StringEscapeUtils.unescapeHtml4(result.getResponseDataAsString())
> @@ -435,6 +437,10 @@ public class RegexExtractor extends Abst
>          return USE_HDRS.equalsIgnoreCase(
> getPropertyAsString(MATCH_AGAINST));
>      }
>
> +    public boolean useRequestHeaders() {
> +        return
> USE_REQUEST_HDRS.equalsIgnoreCase(getPropertyAsString(MATCH_AGAINST));
> +    }
> +
>      // Allow for property not yet being set (probably only applies to
> Test cases)
>      public boolean useBody() {
>          String prop = getPropertyAsString(MATCH_AGAINST);
>
> Modified:
> jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/RegexExtractorGui.java
> URL:
> http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/RegexExtractorGui.java?rev=1614883&r1=1614882&r2=1614883&view=diff
>
> ==============================================================================
> ---
> jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/RegexExtractorGui.java
> (original)
> +++
> jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/RegexExtractorGui.java
> Thu Jul 31 13:28:20 2014
> @@ -61,6 +61,8 @@ public class RegexExtractorGui extends A
>
>      private JRadioButton useHeaders;
>
> +    private JRadioButton useRequestHeaders;
> +
>      private JRadioButton useURL;
>
>      private JRadioButton useCode;
> @@ -86,6 +88,7 @@ public class RegexExtractorGui extends A
>              RegexExtractor re = (RegexExtractor) el;
>              showScopeSettings(re, true);
>              useHeaders.setSelected(re.useHeaders());
> +            useRequestHeaders.setSelected(re.useRequestHeaders());
>              useBody.setSelected(re.useBody());
>              useUnescapedBody.setSelected(re.useUnescapedBody());
>              useBodyAsDocument.setSelected(re.useBodyAsDocument());
> @@ -166,6 +169,7 @@ public class RegexExtractorGui extends A
>          useUnescapedBody = new
> JRadioButton(JMeterUtils.getResString("regex_src_body_unescaped"));
> //$NON-NLS-1$
>          useBodyAsDocument = new
> JRadioButton(JMeterUtils.getResString("regex_src_body_as_document"));
> //$NON-NLS-1$
>          useHeaders = new
> JRadioButton(JMeterUtils.getResString("regex_src_hdrs")); //$NON-NLS-1$
> +        useRequestHeaders = new
> JRadioButton(JMeterUtils.getResString("regex_src_hdrs_req")); //$NON-NLS-1$
>          useURL = new
> JRadioButton(JMeterUtils.getResString("regex_src_url")); //$NON-NLS-1$
>          useCode = new
> JRadioButton(JMeterUtils.getResString("assertion_code_resp")); //$NON-NLS-1$
>          useMessage = new
> JRadioButton(JMeterUtils.getResString("assertion_message_resp"));
> //$NON-NLS-1$
> @@ -175,6 +179,7 @@ public class RegexExtractorGui extends A
>          group.add(useUnescapedBody);
>          group.add(useBodyAsDocument);
>          group.add(useHeaders);
> +        group.add(useRequestHeaders);
>          group.add(useURL);
>          group.add(useCode);
>          group.add(useMessage);
> @@ -183,6 +188,7 @@ public class RegexExtractorGui extends A
>          panel.add(useUnescapedBody);
>          panel.add(useBodyAsDocument);
>          panel.add(useHeaders);
> +        panel.add(useRequestHeaders);
>          panel.add(useURL);
>          panel.add(useCode);
>          panel.add(useMessage);
> @@ -194,6 +200,7 @@ public class RegexExtractorGui extends A
>
>  useUnescapedBody.setActionCommand(RegexExtractor.USE_BODY_UNESCAPED);
>
>  useBodyAsDocument.setActionCommand(RegexExtractor.USE_BODY_AS_DOCUMENT);
>          useHeaders.setActionCommand(RegexExtractor.USE_HDRS);
> +
> useRequestHeaders.setActionCommand(RegexExtractor.USE_REQUEST_HDRS);
>          useURL.setActionCommand(RegexExtractor.USE_URL);
>          useCode.setActionCommand(RegexExtractor.USE_CODE);
>          useMessage.setActionCommand(RegexExtractor.USE_MESSAGE);
>
> Modified:
> jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
> URL:
> http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties?rev=1614883&r1=1614882&r2=1614883&view=diff
>
> ==============================================================================
> --- jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
> (original)
> +++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
> Thu Jul 31 13:28:20 2014
> @@ -776,11 +776,12 @@ regex_params_names_field=Parameter names
>  regex_params_values_field=Parameter values regex group number
>  regex_params_ref_name_field=Regular Expression Reference Name
>  regex_params_title=RegEx User Parameters
> -regex_source=Response Field to check
> +regex_source=Field to check
>  regex_src_body=Body
>  regex_src_body_as_document=Body as a Document
>  regex_src_body_unescaped=Body (unescaped)
> -regex_src_hdrs=Headers
> +regex_src_hdrs=Response Headers
> +regex_src_hdrs_req=Request Headers
>  regex_src_url=URL
>  regexfunc_param_1=Regular expression used to search previous sample - or
> variable.
>  regexfunc_param_2=Template for the replacement string, using groups from
> the regular expression.  Format is $[group]$.  Example $1$.
>
> Modified:
> jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
> URL:
> http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties?rev=1614883&r1=1614882&r2=1614883&view=diff
>
> ==============================================================================
> ---
> jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
> (original)
> +++
> jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
> Thu Jul 31 13:28:20 2014
> @@ -773,7 +773,8 @@ regex_source=Port\u00E9e
>  regex_src_body=Corps
>  regex_src_body_as_document=Corps en tant que Document
>  regex_src_body_unescaped=Corps (non \u00E9chapp\u00E9)
> -regex_src_hdrs=Ent\u00EAtes
> +regex_src_hdrs=Ent\u00EAtes (R\u00E9ponse)
> +regex_src_hdrs_req=Ent\u00EAtes (Requ\u00EAte)
>  regex_src_url=URL
>  regexfunc_param_1=Expression r\u00E9guli\u00E8re utilis\u00E9e pour
> chercher les r\u00E9sultats de la requ\u00EAte pr\u00E9c\u00E9dente.
>  regexfunc_param_2=Canevas pour la ch\u00EEne de caract\u00E8re de
> remplacement, utilisant des groupes d'expressions r\u00E9guli\u00E8res. Le
> format est  $[group]$.  Exemple $1$.
>
> Modified: jmeter/trunk/xdocs/changes.xml
> URL:
> http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1614883&r1=1614882&r2=1614883&view=diff
>
> ==============================================================================
> --- jmeter/trunk/xdocs/changes.xml (original)
> +++ jmeter/trunk/xdocs/changes.xml Thu Jul 31 13:28:20 2014
> @@ -158,6 +158,7 @@ A workaround is to use a Java 7 update 4
>  <li><bugzilla>56162</bugzilla> -  HTTP Cache Manager should not cache
> PUT/POST etc.</li>
>  <li><bugzilla>56227</bugzilla> - AssertionGUI : NPE in assertion on
mouse
> selection</li>
>  <li><bugzilla>41319</bugzilla> - URLRewritingModifier : Allow Parameter
> value to be url encoded</li>
> +<li><bugzilla>52061</bugzilla> - Allow access to Request Headers in
Regex
> Extractor</li>
>  </ul>
>
>  <h3>Functions</h3>
>
> Modified: jmeter/trunk/xdocs/usermanual/component_reference.xml
> URL:
> http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=1614883&r1=1614882&r2=1614883&view=diff
>
> ==============================================================================
> --- jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
> +++ jmeter/trunk/xdocs/usermanual/component_reference.xml Thu Jul 31
> 13:28:20 2014
> @@ -5235,8 +5235,8 @@ generate the template string, and store
>          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:
> +        <property name="Field to check" required="Yes">
> +        The following fields can be checked:
>          <ul>
>          <li>Body - the body of the response, e.g. the content of a
> web-page (excluding headers)</li>
>          <li>Body (unescaped) - the body of the response, with all Html
> escape codes replaced.
> @@ -5245,9 +5245,10 @@ generate the template string, and store
>          <note>Note that this option highly impacts performances, so use
> it only when absolutely necessary and be aware of its impacts</note>
>          </li>
>          <li>Body as a Document - the extract text from various type of
> documents via Apache Tika (see <complink name="View Results Tree"/>
> Document view section).
> -        <note>Note that Body as a Document option can impact
> performances, so ensure it is Ok for your test</note>
> +        <note>Note that the Body as a Document option can impact
> performances, so ensure it is Ok for your test</note>
>          </li>
> -        <li>Headers - may not be present for non-HTTP samples</li>
> +        <li>Request Headers - may not be present for non-HTTP samples</li>
> +        <li>Response Headers - may not be present for non-HTTP
> samples</li>
>          <li>URL</li>
>          <li>Response Code - e.g. 200</li>
>          <li>Response Message - e.g. OK</li>
>
>
>

-- 
Cordialement.
Philippe Mouawad.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message