Bug 54109 - JSR223TestElement : SampleResult properties should be set before entering script to allow user setting different code
JSR223TestElement : SampleResult properties should be set before entering scr...
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
2.8
All All
: P2 enhancement (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2012-11-06 22:19 UTC by Philippe Mouawad
Modified: 2012-11-18 22:37 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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