Dear Wiki user, You have subscribed to a wiki page or wiki category on "Jakarta-jmeter Wiki" for change notification.
The following page has been changed by AndreasZottmann: http://wiki.apache.org/jakarta-jmeter/DeveloperManual/TestBeanTutorial ------------------------------------------------------------------------------ 1. CSVDataSetBeanInfo.java should extend org.apache.jmeter.testbeans.BeanInfoSupport create a zero-parameter constructor in which we call super(CSVDataSet.class); we'll come back to this. 1. CSVDataSetResources.properties - blank for now 1. Implement your special logic for you plugin class. - a. The CSVDataSet will read a single CSV file and will store the values it finds into JMeter's running context. The user will define the file, define the variable names for each "column". The CSVDataSet will open the file when the test starts, and close it when the test ends (thus we implement TestListener). The CSVDataSet will update the contents of the variables for every test thread, and for each iteration through its parent controller, by reading new lines in the file. When we reach the end of the file, we'll start again at the beginning. When implementing a TestBean, pay careful attention to your properties. These properties will become the basis of a gui form by which users will configure the CSVDataSet element. + a. The CSVDataSet will read a single CSV file and will store the values it finds into JMeter's running context. The user will define the file, define the variable names for each "column". The CSVDataSet will open the file when the test starts, and close it when the test ends (thus we implement TestListener). The CSVDataSet will update the contents of the variables for every test thread, and for each iteration through its parent controller, by reading new lines in the file. When we reach the end of the file, we'll start again at the beginning. When implementing a TestBean, pay careful attention to your properties. These properties will become the basis of a gui form by which users will configure the CSVDataSet element. a. Your element will be cloned by JMeter when the test starts. Each thread will get it's own instance. However, you will have a chance to control how the cloning is done, if you need it. a. Properties: ''filename'', ''variableNames''. With public getters and setters. * '''filename''' is self-explanatory, it will hold the name of the CSV file we'll read @@ -64, +64 @@ 1.#8 Debug your component. + ==Remark on variable naming and properties:== + * If you have got a field called "aVariable", the getter and setter should be named like getAVariable/setAVariable (so far that is standard) + * In the .properties file you have to refer to this variable by "AVariable" (capital "A"!). + * The same in the BeanInfoSupport Class: Refer to the variable with "AVariable". + --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
