View | Details | Raw Unified | Return to bug 52061
Collapse All | Expand All

(-)src/core/org/apache/jmeter/resources/messages.properties (-2 / +3 lines)
Lines 776-786 Link Here
776
regex_params_values_field=Parameter values regex group number
776
regex_params_values_field=Parameter values regex group number
777
regex_params_ref_name_field=Regular Expression Reference Name
777
regex_params_ref_name_field=Regular Expression Reference Name
778
regex_params_title=RegEx User Parameters
778
regex_params_title=RegEx User Parameters
779
regex_source=Response Field to check
779
regex_source=Field to check
780
regex_src_body=Body
780
regex_src_body=Body
781
regex_src_body_as_document=Body as a Document
781
regex_src_body_as_document=Body as a Document
782
regex_src_body_unescaped=Body (unescaped)
782
regex_src_body_unescaped=Body (unescaped)
783
regex_src_hdrs=Headers
783
regex_src_hdrs=Resp. Headers
784
regex_src_hdrs_req=Req. Headers
784
regex_src_url=URL
785
regex_src_url=URL
785
regexfunc_param_1=Regular expression used to search previous sample - or variable.
786
regexfunc_param_1=Regular expression used to search previous sample - or variable.
786
regexfunc_param_2=Template for the replacement string, using groups from the regular expression.  Format is $[group]$.  Example $1$.
787
regexfunc_param_2=Template for the replacement string, using groups from the regular expression.  Format is $[group]$.  Example $1$.
(-)src/components/org/apache/jmeter/extractor/RegexExtractor.java (+6 lines)
Lines 62-67 Link Here
62
     *  Do not change these values!
62
     *  Do not change these values!
63
    */
63
    */
64
    public static final String USE_HDRS = "true"; // $NON-NLS-1$
64
    public static final String USE_HDRS = "true"; // $NON-NLS-1$
65
    public static final String USE_REQUEST_HDRS = "request_headers"; // $NON-NLS-1$
65
    public static final String USE_BODY = "false"; // $NON-NLS-1$
66
    public static final String USE_BODY = "false"; // $NON-NLS-1$
66
    public static final String USE_BODY_UNESCAPED = "unescaped"; // $NON-NLS-1$
67
    public static final String USE_BODY_UNESCAPED = "unescaped"; // $NON-NLS-1$
67
    public static final String USE_BODY_AS_DOCUMENT = "as_document"; // $NON-NLS-1$
68
    public static final String USE_BODY_AS_DOCUMENT = "as_document"; // $NON-NLS-1$
Lines 172-177 Link Here
172
    private String getInputString(SampleResult result) {
173
    private String getInputString(SampleResult result) {
173
        String inputString = useUrl() ? result.getUrlAsString() // Bug 39707
174
        String inputString = useUrl() ? result.getUrlAsString() // Bug 39707
174
                : useHeaders() ? result.getResponseHeaders()
175
                : useHeaders() ? result.getResponseHeaders()
176
                : useRequestHeaders() ? result.getRequestHeaders()
175
                : useCode() ? result.getResponseCode() // Bug 43451
177
                : useCode() ? result.getResponseCode() // Bug 43451
176
                : useMessage() ? result.getResponseMessage() // Bug 43451
178
                : useMessage() ? result.getResponseMessage() // Bug 43451
177
                : useUnescapedBody() ? StringEscapeUtils.unescapeHtml4(result.getResponseDataAsString())
179
                : useUnescapedBody() ? StringEscapeUtils.unescapeHtml4(result.getResponseDataAsString())
Lines 433-438 Link Here
433
435
434
    public boolean useHeaders() {
436
    public boolean useHeaders() {
435
        return USE_HDRS.equalsIgnoreCase( getPropertyAsString(MATCH_AGAINST));
437
        return USE_HDRS.equalsIgnoreCase( getPropertyAsString(MATCH_AGAINST));
438
    }
439
440
    public boolean useRequestHeaders() {
441
        return USE_REQUEST_HDRS.equalsIgnoreCase(getPropertyAsString(MATCH_AGAINST));
436
    }
442
    }
437
443
438
    // Allow for property not yet being set (probably only applies to Test cases)
444
    // Allow for property not yet being set (probably only applies to Test cases)
(-)src/components/org/apache/jmeter/extractor/gui/RegexExtractorGui.java (+7 lines)
Lines 61-66 Link Here
61
61
62
    private JRadioButton useHeaders;
62
    private JRadioButton useHeaders;
63
63
64
    private JRadioButton useRequestHeaders;
65
64
    private JRadioButton useURL;
66
    private JRadioButton useURL;
65
67
66
    private JRadioButton useCode;
68
    private JRadioButton useCode;
Lines 86-91 Link Here
86
            RegexExtractor re = (RegexExtractor) el;
88
            RegexExtractor re = (RegexExtractor) el;
87
            showScopeSettings(re, true);
89
            showScopeSettings(re, true);
88
            useHeaders.setSelected(re.useHeaders());
90
            useHeaders.setSelected(re.useHeaders());
91
            useRequestHeaders.setSelected(re.useRequestHeaders());
89
            useBody.setSelected(re.useBody());
92
            useBody.setSelected(re.useBody());
90
            useUnescapedBody.setSelected(re.useUnescapedBody());
93
            useUnescapedBody.setSelected(re.useUnescapedBody());
91
            useBodyAsDocument.setSelected(re.useBodyAsDocument());
94
            useBodyAsDocument.setSelected(re.useBodyAsDocument());
Lines 166-171 Link Here
166
        useUnescapedBody = new JRadioButton(JMeterUtils.getResString("regex_src_body_unescaped")); //$NON-NLS-1$
169
        useUnescapedBody = new JRadioButton(JMeterUtils.getResString("regex_src_body_unescaped")); //$NON-NLS-1$
167
        useBodyAsDocument = new JRadioButton(JMeterUtils.getResString("regex_src_body_as_document")); //$NON-NLS-1$
170
        useBodyAsDocument = new JRadioButton(JMeterUtils.getResString("regex_src_body_as_document")); //$NON-NLS-1$
168
        useHeaders = new JRadioButton(JMeterUtils.getResString("regex_src_hdrs")); //$NON-NLS-1$
171
        useHeaders = new JRadioButton(JMeterUtils.getResString("regex_src_hdrs")); //$NON-NLS-1$
172
        useRequestHeaders = new JRadioButton(JMeterUtils.getResString("regex_src_hdrs_req")); //$NON-NLS-1$
169
        useURL = new JRadioButton(JMeterUtils.getResString("regex_src_url")); //$NON-NLS-1$
173
        useURL = new JRadioButton(JMeterUtils.getResString("regex_src_url")); //$NON-NLS-1$
170
        useCode = new JRadioButton(JMeterUtils.getResString("assertion_code_resp")); //$NON-NLS-1$
174
        useCode = new JRadioButton(JMeterUtils.getResString("assertion_code_resp")); //$NON-NLS-1$
171
        useMessage = new JRadioButton(JMeterUtils.getResString("assertion_message_resp")); //$NON-NLS-1$
175
        useMessage = new JRadioButton(JMeterUtils.getResString("assertion_message_resp")); //$NON-NLS-1$
Lines 175-180 Link Here
175
        group.add(useUnescapedBody);
179
        group.add(useUnescapedBody);
176
        group.add(useBodyAsDocument);
180
        group.add(useBodyAsDocument);
177
        group.add(useHeaders);
181
        group.add(useHeaders);
182
        group.add(useRequestHeaders);
178
        group.add(useURL);
183
        group.add(useURL);
179
        group.add(useCode);
184
        group.add(useCode);
180
        group.add(useMessage);
185
        group.add(useMessage);
Lines 183-188 Link Here
183
        panel.add(useUnescapedBody);
188
        panel.add(useUnescapedBody);
184
        panel.add(useBodyAsDocument);
189
        panel.add(useBodyAsDocument);
185
        panel.add(useHeaders);
190
        panel.add(useHeaders);
191
        panel.add(useRequestHeaders);
186
        panel.add(useURL);
192
        panel.add(useURL);
187
        panel.add(useCode);
193
        panel.add(useCode);
188
        panel.add(useMessage);
194
        panel.add(useMessage);
Lines 194-199 Link Here
194
        useUnescapedBody.setActionCommand(RegexExtractor.USE_BODY_UNESCAPED);
200
        useUnescapedBody.setActionCommand(RegexExtractor.USE_BODY_UNESCAPED);
195
        useBodyAsDocument.setActionCommand(RegexExtractor.USE_BODY_AS_DOCUMENT);
201
        useBodyAsDocument.setActionCommand(RegexExtractor.USE_BODY_AS_DOCUMENT);
196
        useHeaders.setActionCommand(RegexExtractor.USE_HDRS);
202
        useHeaders.setActionCommand(RegexExtractor.USE_HDRS);
203
        useRequestHeaders.setActionCommand(RegexExtractor.USE_REQUEST_HDRS);
197
        useURL.setActionCommand(RegexExtractor.USE_URL);
204
        useURL.setActionCommand(RegexExtractor.USE_URL);
198
        useCode.setActionCommand(RegexExtractor.USE_CODE);
205
        useCode.setActionCommand(RegexExtractor.USE_CODE);
199
        useMessage.setActionCommand(RegexExtractor.USE_MESSAGE);
206
        useMessage.setActionCommand(RegexExtractor.USE_MESSAGE);

Return to bug 52061