27
27
import org .apache .jmeter .save .CSVSaveService ;
28
28
import org .apache .jmeter .testbeans .TestBean ;
29
29
import org .apache .jmeter .threads .JMeterContext ;
30
+ import org .apache .jmeter .threads .JMeterContextService ;
30
31
import org .apache .jmeter .threads .JMeterVariables ;
31
32
import org .apache .jorphan .util .JMeterStopThreadException ;
32
33
import org .apache .jorphan .util .JOrphanUtils ;
@@ -87,7 +88,7 @@ public void iterationStart(LoopIterationEvent iterEvent) {
87
88
}catch (IOException e ){
88
89
LOGGER .error (e .toString ());
89
90
}
90
- LOGGER .debug ("Sequential" );
91
+ LOGGER .debug ("Sequential :: " + lineValues );
91
92
break ;
92
93
case ExtendedCsvDataSetBeanInfo .UNIQUE :
93
94
try {
@@ -100,7 +101,7 @@ public void iterationStart(LoopIterationEvent iterEvent) {
100
101
}catch (IOException e ){
101
102
LOGGER .error (e .toString ());
102
103
}
103
- LOGGER .debug ("Unique" );
104
+ LOGGER .debug ("Unique :: " + lineValues );
104
105
break ;
105
106
case ExtendedCsvDataSetBeanInfo .RANDOM :
106
107
try {
@@ -113,10 +114,10 @@ public void iterationStart(LoopIterationEvent iterEvent) {
113
114
}catch (IOException e ){
114
115
LOGGER .error (e .toString ());
115
116
}
116
- LOGGER .info ( "debug" );
117
+ LOGGER .debug ( "Random :: " + lineValues );
117
118
break ;
118
119
default :
119
- LOGGER .info ( "Default " );
120
+ LOGGER .debug ( "Invalid selection on Select row " );
120
121
throw new JMeterStopThreadException ("Invalid selection :" + getFilename () + " detected for Extended CSV DataSet:"
121
122
+ getName () + " configured to Select Row Parameter :" + getSelectRow ());
122
123
}
@@ -141,7 +142,7 @@ public void iterationStart(LoopIterationEvent iterEvent) {
141
142
}
142
143
break ;
143
144
default :
144
- LOGGER .info ( "Default " );
145
+ LOGGER .debug ( "Invalid selection on Update Value " );
145
146
throw new JMeterStopThreadException ("Invalid selection :" + getFilename () + " detected for Extended CSV DataSet:"
146
147
+ getName () + " configured to Select Row Parameter :" + getUpdateValue ());
147
148
}
@@ -150,13 +151,14 @@ public void iterationStart(LoopIterationEvent iterEvent) {
150
151
private void initBlockFeatures (String filename , JMeterContext context , ExtFileServer fServer , boolean autoAllocate , String blockSize ) throws IOException {
151
152
int blockSizeInt ;
152
153
String threadName = context .getThread ().getThreadName ();
153
- //Integer.parseInt(context.getThread().getThreadName().substring(context.getThread().getThreadName().lastIndexOf('-') + 1)))
154
- if (ExtFileServer .getListSize () < 1 ){
154
+
155
+ if (fServer .getListSize () < 1 ){
155
156
fServer .reserveFile (filename , getFileEncoding (), alias , ignoreFirstLine );
156
- fServer .loadCsv (filename , isIgnoreFirstLine () );
157
+ fServer .loadCsv (filename , ignoreFirstLine );
157
158
}
159
+
158
160
if (autoAllocate ){
159
- blockSizeInt = ExtFileServer .getListSize () / context . getThreadGroup (). getNumberOfThreads ();
161
+ blockSizeInt = ExtFileServer .getListSize () / JMeterContextService . getTotalThreads ();
160
162
}else {
161
163
blockSizeInt = Integer .parseInt (blockSize );
162
164
}
@@ -186,7 +188,7 @@ private void initVars(ExtFileServer server, final JMeterContext context, String
186
188
String header = server .reserveFile (fileName , getFileEncoding (), alias , true );
187
189
try {
188
190
variables = CSVSaveService .csvSplitString (header , delim .charAt (0 ));
189
- firstLineIsNames = true ;
191
+ firstLineIsNames = true ;ignoreFirstLine = true ;
190
192
} catch (IOException e ) {
191
193
throw new IllegalArgumentException ("Could not split CSV header line from file:" + fileName , e );
192
194
}
@@ -253,7 +255,10 @@ public String getVariableNames() {
253
255
}
254
256
255
257
public void setVariableNames (String variableNames ) {
256
- this .variableNames = variableNames ;
258
+ // this.variableNames = variableNames;
259
+ if (!ignoreFirstLine ){
260
+ this .variableNames = variableNames ;
261
+ }
257
262
}
258
263
259
264
public String getDelimiter () {
0 commit comments