Bug 54109

Summary: JSR223TestElement : SampleResult properties should be set before entering script to allow user setting different code
Product: JMeter - Now in Github Reporter: Philippe Mouawad <p.mouawad>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: enhancement CC: p.mouawad
Priority: P2    
Version: 2.8   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Philippe Mouawad 2012-11-06 22:19:48 UTC
Currently JSR223Sampler calls these methods after script has been executed:
result.setSuccessful(true);
            result.setResponseCodeOK();
            result.setResponseMessageOK();
            if (ret != null){
                result.setResponseData(ret.toString(), null);
            }


This does not allow script to set:
- Different response code than 200
- Different message
- And response data is overriden by ret.toString()

I think this should be changed, JSR223Sampler should call these before calling script and script would be able to change that.

It could break existing script that set these values to non successful ones and make assertions fails so a jmeter property could be introduced although I am not in favor of this as I think in fact scripts that do that are wrong and it is hidden currently.
Comment 1 Philippe Mouawad 2012-11-18 22:37:24 UTC
Date: Sun Nov 18 22:29:35 2012
New Revision: 1411006

URL: http://svn.apache.org/viewvc?rev=1411006&view=rev
Log:
Bug 54109 - JSR223TestElement : SampleResult properties should be set before entering script to allow user setting different code
Bugzilla Id: 54109

Modified:
    jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JSR223Sampler.java
    jmeter/trunk/xdocs/changes.xml



Date: Sun Nov 18 22:34:56 2012
New Revision: 1411008

URL: http://svn.apache.org/viewvc?rev=1411008&view=rev
Log:
Bug 54109 - JSR223TestElement : SampleResult properties should be set before entering script to allow user setting different code
Bugzilla Id: 54109

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
Comment 2 The ASF infrastructure team 2022-09-24 20:37:52 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2971