View | Details | Raw Unified | Return to bug 60081
Collapse All | Expand All

(-)src/components/org/apache/jmeter/control/InterleaveControl.java (-1 / +25 lines)
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
}
(-)src/components/org/apache/jmeter/control/gui/InterleaveControlGui.java (-1 / +11 lines)
Lines 30-35 Link Here
30
    private static final long serialVersionUID = 240L;
30
    private static final long serialVersionUID = 240L;
31
31
32
    private JCheckBox style;
32
    private JCheckBox style;
33
    
34
    private JCheckBox accrossThreads;
33
35
34
    public InterleaveControlGui() {
36
    public InterleaveControlGui() {
35
        init();
37
        init();
Lines 38-48 Link Here
38
    @Override
40
    @Override
39
    public void configure(TestElement el) {
41
    public void configure(TestElement el) {
40
        super.configure(el);
42
        super.configure(el);
41
        if (((InterleaveControl) el).getStyle() == InterleaveControl.IGNORE_SUB_CONTROLLERS) {
43
        InterleaveControl controller = (InterleaveControl) el;
44
        if (controller.getStyle() == InterleaveControl.IGNORE_SUB_CONTROLLERS) {
42
            style.setSelected(true);
45
            style.setSelected(true);
43
        } else {
46
        } else {
44
            style.setSelected(false);
47
            style.setSelected(false);
45
        }
48
        }
49
        accrossThreads.setSelected(controller.getInterleaveAccrossThreads());
46
    }
50
    }
47
51
48
    @Override
52
    @Override
Lines 65-70 Link Here
65
        } else {
69
        } else {
66
            ((InterleaveControl) ic).setStyle(InterleaveControl.USE_SUB_CONTROLLERS);
70
            ((InterleaveControl) ic).setStyle(InterleaveControl.USE_SUB_CONTROLLERS);
67
        }
71
        }
72
        
73
        ((InterleaveControl) ic).setInterleaveAccrossThreads(accrossThreads.isSelected());
68
    }
74
    }
69
75
70
    /**
76
    /**
Lines 74-79 Link Here
74
    public void clearGui() {
80
    public void clearGui() {
75
        super.clearGui();
81
        super.clearGui();
76
        style.setSelected(false);
82
        style.setSelected(false);
83
        accrossThreads.setSelected(false);
77
    }
84
    }
78
85
79
    @Override
86
    @Override
Lines 89-93 Link Here
89
96
90
        style = new JCheckBox(JMeterUtils.getResString("ignore_subcontrollers")); // $NON-NLS-1$
97
        style = new JCheckBox(JMeterUtils.getResString("ignore_subcontrollers")); // $NON-NLS-1$
91
        add(CheckBoxPanel.wrap(style));
98
        add(CheckBoxPanel.wrap(style));
99
        
100
        accrossThreads = new JCheckBox(JMeterUtils.getResString("interleave_accross_threads")); // $NON-NLS-1$
101
        add(CheckBoxPanel.wrap(accrossThreads));
92
    }
102
    }
93
}
103
}

Return to bug 60081