Bug 52728

Summary: CSV Data Set Config element cannot coexist with BSF Sampler in same Thread Plan
Product: JMeter - Now in Github Reporter: Bakir Jusufbegovic <ext-bakir.jusufbegovic>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: normal CC: jomebrew, p.mouawad
Priority: P2    
Version: 2.6   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Simplified Test Plan
Possible patch to prevent CSVDataset from affecting BSF Sampler
simple example

Description Bakir Jusufbegovic 2012-02-21 11:59:58 UTC
Here is a quick overview of the problem:

If there is a BSF sampler in JMeter script and also CSV Data Set Config that loads some external file like *.csv, for some reason, that represents a sign to BSF Sampler that this external file is BSF Script that needs to be loaded in JMeter during execution of the script (In general, these two components shouldn’t have anything to do with each other and variable from CSV Data Set Config shouldn’t be visible from BSF Sampler component). Because it cannot find this file on the path, error with following message will happen:

Response message: java.io.FileNotFoundException: ${SOME_FILE_PATH} (The system cannot find the file specified)

Also, with new JMeter 2.6 following drop down menu was added: Script file (overrides script)
When trying to change value from drop down menu and then change focus to some other element and then retrieve back, drop down menu value was reset so it will always try to load bsf script from external file.

I think that two fixes need to be introduced:
1. Sharing of variables between CSV Data Set Config and BSF Sampler component shouldnt be permitted
2. Chosen value from Script File drop down menu in BSF Sampler should remain even if we change focus from that component
Comment 1 Philippe Mouawad 2012-02-21 12:13:27 UTC
Please submit a simplified Test Plan to reproduce the issue.
Regards
Comment 2 Bakir Jusufbegovic 2012-02-21 12:23:09 UTC
In orer
Comment 3 Bakir Jusufbegovic 2012-02-21 12:24:33 UTC
Created attachment 28358 [details]
Simplified Test Plan

Attached is simplified Test Plan that shows this defect.
In this test plan there are two samplers:
1. BSF Sampler
2. BeanShell Sampler
and one CSV Data Set Config

BeanShell Sampler will work without a problem but BSF will fail.
Comment 4 Sebb 2012-02-21 12:36:04 UTC
The problem is that the Config element variables from CSV Dataset are being merged into the variables for the BSF sampler. It so happens that they both use the same name, whereas BSH uses a different name.

This may not be easy to fix, as we need to maintain backwards compatibility.
Comment 5 Sebb 2012-02-23 21:17:09 UTC
Created attachment 28375 [details]
Possible patch to prevent CSVDataset from affecting BSF Sampler
Comment 6 Sebb 2012-02-23 23:42:29 UTC
Just realised that patch won't build with Ant, because CSVDataSet (components) is compiled after TestCompiler (core).

Could perhaps use a marker interface for Config elements that are stand-alone?
Comment 7 Sebb 2012-02-24 01:12:49 UTC
Fixed using new marker interface.

URL: http://svn.apache.org/viewvc?rev=1293052&view=rev
Log:
Bug 52728 - CSV Data Set Config element cannot coexist with BSF Sampler in same Thread Plan

Added:
   jmeter/trunk/src/core/org/apache/jmeter/engine/util/NoConfigMerge.java   (with props)
Modified:
   jmeter/trunk/src/components/org/apache/jmeter/config/CSVDataSet.java
   jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java
   jmeter/trunk/xdocs/changes.xml
Comment 8 Philippe Mouawad 2012-04-03 20:28:16 UTC
*** Bug 53030 has been marked as a duplicate of this bug. ***
Comment 9 jomebrew 2012-04-03 21:31:56 UTC
(In reply to comment #8)
> *** Bug 53030 has been marked as a duplicate of this bug. ***

Replaced the Bin and Lib directories with the last night (4/03) build.   

Still has same problem.


Attaching simple procedure
Comment 10 jomebrew 2012-04-03 21:32:27 UTC
Created attachment 28541 [details]
simple example
Comment 11 The ASF infrastructure team 2022-09-24 20:37:49 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2747