|
13 | 13 | import org.apache.jmeter.threads.JMeterContext;
|
14 | 14 | import org.apache.jmeter.threads.JMeterContextService;
|
15 | 15 | import org.apache.jmeter.threads.JMeterVariables;
|
| 16 | +import org.apache.jmeter.util.JMeterUtils; |
16 | 17 | import org.apache.jorphan.util.JMeterStopThreadException;
|
17 | 18 | import org.apache.jorphan.util.JOrphanUtils;
|
18 | 19 | import org.slf4j.Logger;
|
|
23 | 24 | public class ExtendedCsvDataSetConfig extends ConfigTestElement implements LoopIterationListener, TestStateListener, NoConfigMerge {
|
24 | 25 | private static final long serialVersionUID = 767792680142202807L;
|
25 | 26 | private static final Logger LOGGER = LoggerFactory.getLogger(ExtendedCsvDataSetConfig.class);
|
| 27 | + |
| 28 | + private static final String EOFVALUE = JMeterUtils.getPropDefault("csvdataset.eofstring", "<EOF>"); |
26 | 29 | public static final String FILENAME = "filename";
|
27 | 30 | public static final String FILE_ENCODING = "fileEncoding";
|
28 | 31 | public static final String VARIABLE_NAMES = "variableNames";
|
@@ -101,14 +104,13 @@ public void iterationStart(LoopIterationEvent iterationEvent) {
|
101 | 104 | // Update Value --> Each Iteration, Once
|
102 | 105 | switch (getPropertyAsString(UPDATE_VALUE).toLowerCase()) {
|
103 | 106 | case "each iteration":
|
104 |
| - if(lineValues.length > 0){ |
| 107 | + if (lineValues.length == 0) { |
| 108 | + throw new JMeterStopThreadException("End of file:"+ getFilename()+" detected for CSV DataSet:" |
| 109 | + +getName()+" configured to Select Row Parameter :" + getUpdateValue()); |
| 110 | + } else { |
105 | 111 | for (int a = 0; a < variables.length && a < lineValues.length; a++) {
|
106 | 112 | jMeterVariables.put(variables[a], lineValues[a]);
|
107 | 113 | }
|
108 |
| - }else { |
109 |
| - for (String variable : variables) { |
110 |
| - jMeterVariables.put(variable, null); |
111 |
| - } |
112 | 114 | }
|
113 | 115 | break;
|
114 | 116 | case "once":
|
|
0 commit comments