mirror of https://github.com/apache/jmeter.git
Bug 41612 - Loop nested in IF behaves erratically
git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/branches/rel-2-2@551743 13f79535-47bb-0310-9956-ffa450edef68
Former-commit-id: 9f6087b9bf
This commit is contained in:
parent
8e68024c2c
commit
a8334008ff
|
|
@ -137,16 +137,18 @@ public class IfController extends GenericController implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.apache.jmeter.control.Controller#next() 'JMeterThread' iterates
|
* @see org.apache.jmeter.control.Controller#next()
|
||||||
* thru the Controller by calling this method. IF a valid 'Sampler' is
|
|
||||||
* returned, then it executes the sampler (calls sampler.sampler(xxx)
|
|
||||||
* method) . So here we make sure that the samplers belonging to this
|
|
||||||
* Controller do not get called - if isDone is true - if its the first
|
|
||||||
* time this is run. The first time is special cause it is called prior
|
|
||||||
* the iteration even starts !
|
|
||||||
*/
|
*/
|
||||||
public Sampler next() {
|
public Sampler next() {
|
||||||
boolean result = evaluateCondition(getCondition());
|
// We should only evalute the condition if it is the first
|
||||||
|
// time ( first "iteration" ) we are called.
|
||||||
|
// For subsequent calls, we are inside the IfControllerGroup,
|
||||||
|
// so then we just pass the control to the next item inside the if control
|
||||||
|
boolean result = true;
|
||||||
|
if(isFirst()) {
|
||||||
|
result = evaluateCondition(getCondition());
|
||||||
|
}
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
return super.next();
|
return super.next();
|
||||||
}
|
}
|
||||||
|
|
@ -156,4 +158,4 @@ public class IfController extends GenericController implements Serializable {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -263,6 +263,7 @@ Removed deprecated method JMeterUtils.split() - use JOrphanUtils version instead
|
||||||
<li>Function methods setParameters() need to be synchronized</li>
|
<li>Function methods setParameters() need to be synchronized</li>
|
||||||
<li>Fix CLI long optional argument to require "=" (as for short options)</li>
|
<li>Fix CLI long optional argument to require "=" (as for short options)</li>
|
||||||
<li>Fix SlowSocket to work properly with Httpclient (both http and https)</li>
|
<li>Fix SlowSocket to work properly with Httpclient (both http and https)</li>
|
||||||
|
<li>Bug 41612 - Loop nested in IF behaves erratically</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3>Version 2.2</h3>
|
<h3>Version 2.2</h3>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue