Lines 22-36
Link Here
|
22 |
|
22 |
|
23 |
import org.apache.jmeter.samplers.Sampler; |
23 |
import org.apache.jmeter.samplers.Sampler; |
24 |
import org.apache.jmeter.testelement.TestElement; |
24 |
import org.apache.jmeter.testelement.TestElement; |
|
|
25 |
import org.apache.jmeter.testelement.property.BooleanProperty; |
25 |
import org.apache.jmeter.testelement.property.IntegerProperty; |
26 |
import org.apache.jmeter.testelement.property.IntegerProperty; |
26 |
|
27 |
|
27 |
/** |
28 |
/** |
28 |
* Alternate among each of the children controllers or samplers for each loop iteration |
29 |
* Alternate among each of the children controllers or samplers for each loop iteration |
29 |
*/ |
30 |
*/ |
30 |
public class InterleaveControl extends GenericController implements Serializable { |
31 |
public class InterleaveControl extends GenericController implements Serializable { |
31 |
private static final long serialVersionUID = 233L; |
32 |
|
|
|
33 |
private static final long serialVersionUID = 234L; |
32 |
|
34 |
|
33 |
private static final String STYLE = "InterleaveControl.style";// $NON-NLS-1$ |
35 |
private static final String STYLE = "InterleaveControl.style";// $NON-NLS-1$ |
|
|
36 |
|
37 |
private static final String ACCROSS_THREADS = "InterleaveControl.accrossThreads";// $NON-NLS-1$ |
34 |
|
38 |
|
35 |
public static final int IGNORE_SUB_CONTROLLERS = 0; |
39 |
public static final int IGNORE_SUB_CONTROLLERS = 0; |
36 |
|
40 |
|
Lines 71-76
Link Here
|
71 |
public int getStyle() { |
75 |
public int getStyle() { |
72 |
return getPropertyAsInt(STYLE); |
76 |
return getPropertyAsInt(STYLE); |
73 |
} |
77 |
} |
|
|
78 |
|
79 |
public void setInterleaveAccrossThreads(boolean accrossThreads) { |
80 |
setProperty(new BooleanProperty(ACCROSS_THREADS, accrossThreads)); |
81 |
} |
82 |
|
83 |
public boolean getInterleaveAccrossThreads() { |
84 |
return getPropertyAsBoolean(ACCROSS_THREADS, false); |
85 |
} |
74 |
|
86 |
|
75 |
/** |
87 |
/** |
76 |
* {@inheritDoc} |
88 |
* {@inheritDoc} |
Lines 174-177
Link Here
|
174 |
stillSame = false; |
186 |
stillSame = false; |
175 |
super.incrementCurrent(); |
187 |
super.incrementCurrent(); |
176 |
} |
188 |
} |
|
|
189 |
|
190 |
/* (non-Javadoc) |
191 |
* @see org.apache.jmeter.control.GenericController#initialize() |
192 |
*/ |
193 |
@Override |
194 |
public void initialize() { |
195 |
super.initialize(); |
196 |
// get a different start index |
197 |
if(getInterleaveAccrossThreads()) { |
198 |
this.current = getThreadContext().getThreadNum()%getSubControllers().size(); |
199 |
} |
200 |
} |
177 |
} |
201 |
} |