2727import org .apache .jmeter .save .CSVSaveService ;
2828import org .apache .jmeter .testbeans .TestBean ;
2929import org .apache .jmeter .threads .JMeterContext ;
30+ import org .apache .jmeter .threads .JMeterContextService ;
3031import org .apache .jmeter .threads .JMeterVariables ;
3132import org .apache .jorphan .util .JMeterStopThreadException ;
3233import org .apache .jorphan .util .JOrphanUtils ;
@@ -87,7 +88,7 @@ public void iterationStart(LoopIterationEvent iterEvent) {
8788 }catch (IOException e ){
8889 LOGGER .error (e .toString ());
8990 }
90- LOGGER .debug ("Sequential" );
91+ LOGGER .debug ("Sequential :: " + lineValues );
9192 break ;
9293 case ExtendedCsvDataSetBeanInfo .UNIQUE :
9394 try {
@@ -100,7 +101,7 @@ public void iterationStart(LoopIterationEvent iterEvent) {
100101 }catch (IOException e ){
101102 LOGGER .error (e .toString ());
102103 }
103- LOGGER .debug ("Unique" );
104+ LOGGER .debug ("Unique :: " + lineValues );
104105 break ;
105106 case ExtendedCsvDataSetBeanInfo .RANDOM :
106107 try {
@@ -113,10 +114,10 @@ public void iterationStart(LoopIterationEvent iterEvent) {
113114 }catch (IOException e ){
114115 LOGGER .error (e .toString ());
115116 }
116- LOGGER .info ( "debug" );
117+ LOGGER .debug ( "Random :: " + lineValues );
117118 break ;
118119 default :
119- LOGGER .info ( "Default " );
120+ LOGGER .debug ( "Invalid selection on Select row " );
120121 throw new JMeterStopThreadException ("Invalid selection :" + getFilename () + " detected for Extended CSV DataSet:"
121122 + getName () + " configured to Select Row Parameter :" + getSelectRow ());
122123 }
@@ -141,7 +142,7 @@ public void iterationStart(LoopIterationEvent iterEvent) {
141142 }
142143 break ;
143144 default :
144- LOGGER .info ( "Default " );
145+ LOGGER .debug ( "Invalid selection on Update Value " );
145146 throw new JMeterStopThreadException ("Invalid selection :" + getFilename () + " detected for Extended CSV DataSet:"
146147 + getName () + " configured to Select Row Parameter :" + getUpdateValue ());
147148 }
@@ -150,13 +151,14 @@ public void iterationStart(LoopIterationEvent iterEvent) {
150151 private void initBlockFeatures (String filename , JMeterContext context , ExtFileServer fServer , boolean autoAllocate , String blockSize ) throws IOException {
151152 int blockSizeInt ;
152153 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 ){
155156 fServer .reserveFile (filename , getFileEncoding (), alias , ignoreFirstLine );
156- fServer .loadCsv (filename , isIgnoreFirstLine () );
157+ fServer .loadCsv (filename , ignoreFirstLine );
157158 }
159+
158160 if (autoAllocate ){
159- blockSizeInt = ExtFileServer .getListSize () / context . getThreadGroup (). getNumberOfThreads ();
161+ blockSizeInt = ExtFileServer .getListSize () / JMeterContextService . getTotalThreads ();
160162 }else {
161163 blockSizeInt = Integer .parseInt (blockSize );
162164 }
@@ -186,7 +188,7 @@ private void initVars(ExtFileServer server, final JMeterContext context, String
186188 String header = server .reserveFile (fileName , getFileEncoding (), alias , true );
187189 try {
188190 variables = CSVSaveService .csvSplitString (header , delim .charAt (0 ));
189- firstLineIsNames = true ;
191+ firstLineIsNames = true ;ignoreFirstLine = true ;
190192 } catch (IOException e ) {
191193 throw new IllegalArgumentException ("Could not split CSV header line from file:" + fileName , e );
192194 }
@@ -253,7 +255,10 @@ public String getVariableNames() {
253255 }
254256
255257 public void setVariableNames (String variableNames ) {
256- this .variableNames = variableNames ;
258+ // this.variableNames = variableNames;
259+ if (!ignoreFirstLine ){
260+ this .variableNames = variableNames ;
261+ }
257262 }
258263
259264 public String getDelimiter () {
0 commit comments