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.
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
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2971