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

(-)src/core/org/apache/jmeter/control/IfController.java (-1 / +1 lines)
Lines 174-180 Link Here
174
     * @return the condition associated with this controller
174
     * @return the condition associated with this controller
175
     */
175
     */
176
    public String getCondition() {
176
    public String getCondition() {
177
        return getPropertyAsString(CONDITION);
177
        return getPropertyAsString(CONDITION).trim();
178
    }
178
    }
179
179
180
    /**
180
    /**
(-)test/src/org/apache/jmeter/control/TestIfController.java (+25 lines)
Lines 19-24 Link Here
19
package org.apache.jmeter.control;
19
package org.apache.jmeter.control;
20
20
21
import static org.junit.Assert.assertEquals;
21
import static org.junit.Assert.assertEquals;
22
import static org.junit.Assert.assertFalse;
22
import static org.junit.Assert.fail;
23
import static org.junit.Assert.fail;
23
24
24
import org.apache.jmeter.config.Arguments;
25
import org.apache.jmeter.config.Arguments;
Lines 294-297 Link Here
294
        }
295
        }
295
        assertEquals(counter, 6);
296
        assertEquals(counter, 6);
296
    }
297
    }
298
    
299
    @Test
300
    @Ignore
301
    public void shouldIgnoreEmptyLastLine() {
302
        JMeterVariables vars = new JMeterVariables();
303
        JMeterContextService.getContext().setVariables(vars);
304
        vars.putObject("VAR1", Long.valueOf(1));
305
306
        GenericController controller = new GenericController();
307
308
        IfController ifCont = new IfController("${__jexl3(${VAR1} == 1)}");
309
        ifCont.setUseExpression(true);
310
        ifCont.setEvaluateAll(false);
311
312
        ifCont.addTestElement(new TestSampler("sample1"));
313
        controller.addTestElement(ifCont);
314
315
        controller.initialize();
316
        controller.setRunningVersion(true);
317
        ifCont.setRunningVersion(true);
318
319
        Sampler sampler = controller.next();
320
        assertFalse(sampler == null);
321
    }
297
}
322
}

Return to bug 63064