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

(-)C:/Documents and Settings/alf.hogemark/workspace/Jmeter 2.2 official/src/core/org/apache/jmeter/control/IfController.java (-9 / +11 lines)
Lines 137-152 Link Here
137
	}
138
	}
138
139
139
	/**
140
	/**
140
	 * @see org.apache.jmeter.control.Controller#next() 'JMeterThread' iterates
141
	 * @see org.apache.jmeter.control.Controller#next()
141
	 *      thru the Controller by calling this method. IF a valid 'Sampler' is
142
	 *      returned, then it executes the sampler (calls sampler.sampler(xxx)
143
	 *      method) . So here we make sure that the samplers belonging to this
144
	 *      Controller do not get called - if isDone is true - if its the first
145
	 *      time this is run. The first time is special cause it is called prior
146
	 *      the iteration even starts !
147
	 */
142
	 */
148
	public Sampler next() {
143
	public Sampler next() {
149
		boolean result = evaluateCondition(getCondition());
144
        // We should only evalute the condition if it is the first
145
        // time ( first "iteration" ) we are called.
146
        // For subsequent calls, we are inside the IfControllerGroup,
147
        // so then we just pass the control to the next item inside the if control
148
        boolean result = true;
149
        if(isFirst()) {
150
            result = evaluateCondition(getCondition());
151
        }
152
        
150
		if (result) {
153
		if (result) {
151
			return super.next();
154
			return super.next();
152
		}
155
		}
Lines 156-159 Link Here
156
			return null;
159
			return null;
157
		}
160
		}
158
	}
161
	}
159
}
162
}
(-)C:/Documents and Settings/alf.hogemark/workspace/Jmeter 2.2 official/src/core/org/apache/jmeter/threads/gui/ThreadGroupGui.java (-1 / +4 lines)
Lines 104-110 Link Here
104
	public void modifyTestElement(TestElement tg) {
104
	public void modifyTestElement(TestElement tg) {
105
		super.configureTestElement(tg);
105
		super.configureTestElement(tg);
106
		if (tg instanceof ThreadGroup) {
106
		if (tg instanceof ThreadGroup) {
107
			((ThreadGroup) tg).setSamplerController((LoopController) loopPanel.createTestElement());
107
            // Create and set the name of the LoopController which controls this ThreadGroup
108
            LoopController loopController = (LoopController)loopPanel.createTestElement();
109
            loopController.setName("Loop for ThreadGroup " + getName());
110
			((ThreadGroup) tg).setSamplerController(loopController);
108
		}
111
		}
109
112
110
		tg.setProperty(ThreadGroup.NUM_THREADS, threadInput.getText());
113
		tg.setProperty(ThreadGroup.NUM_THREADS, threadInput.getText());

Return to bug 41612