Class CSVDataSet

  • All Implemented Interfaces:
    java.io.Serializable , java.lang.Cloneable , org.apache.jmeter.config.ConfigElement , org.apache.jmeter.engine.event.LoopIterationListener , org.apache.jmeter.engine.util.NoConfigMerge , org.apache.jmeter.gui.Searchable , org.apache.jmeter.testbeans.TestBean , org.apache.jmeter.testelement.TestElement

    
    public class CSVDataSet
    extends ConfigTestElement implements TestBean, LoopIterationListener, NoConfigMerge
                        

    Read lines from a file and split int variables. The iterationStart() method is used to set up each set of values. By default, the same file is shared between all threads (and other thread groups, if they use the same file name). The shareMode can be set to:

    • All threads - default, as described above
    • Current thread group
    • Current thread
    • Identifier - all threads sharing the same identifier
    The class uses the FileServer alias mechanism to provide the different share modes. For all threads, the file alias is set to the file name. Otherwise, a suffix is appended to the filename to make it unique within the required context. For current thread group, the thread group identityHashcode is used; for individual threads, the thread hashcode is used as the suffix. Or the user can provide their own suffix, in which case the file is shared between all threads with the same suffix.
    • Constructor Detail

      • CSVDataSet

        CSVDataSet()
    • Method Detail

      • setFilename

         void setFilename(String filename)
        Parameters:
        filename - The filename to set.
      • setFileEncoding

         void setFileEncoding(String fileEncoding)
        Parameters:
        fileEncoding - The fileEncoding to set.
      • setVariableNames

         void setVariableNames(String variableNames)
        Parameters:
        variableNames - The variableNames to set.
      • setProperty

         void setProperty(JMeterProperty property)

        Override the setProperty method in order to convert the original String shareMode property. This used the locale-dependent display value, so caused problems when the language was changed. If the "shareMode" value matches a resource value then it is converted into the resource key. To reduce the need to look up resources, we only attempt to convert values with spaces in them, as these are almost certainly not variables (and they are definitely not resource keys).

      • setIgnoreFirstLine

         void setIgnoreFirstLine(boolean ignoreFirstLine)
        Parameters:
        ignoreFirstLine - the ignoreFirstLine to set