Bug 52728 - CSV Data Set Config element cannot coexist with BSF Sampler in same Thread Plan
CSV Data Set Config element cannot coexist with BSF Sampler in same Thread Plan
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
2.6
PC All
: P2 normal (vote)
: ---
Assigned To: JMeter issues mailing list
:
: 53030 (view as bug list)
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2012-02-21 11:59 UTC by Bakir Jusufbegovic
Modified: 2012-04-03 21:32 UTC (History)
2 users (show)



Attachments
Simplified Test Plan (1.65 KB, application/octet-stream)
2012-02-21 12:24 UTC, Bakir Jusufbegovic
Details
Possible patch to prevent CSVDataset from affecting BSF Sampler (970 bytes, patch)
2012-02-23 21:17 UTC, Sebb
Details | Diff
simple example (24.05 KB, application/octet-stream)
2012-04-03 21:32 UTC, jomebrew
Details

Note You need to log in before you can comment on or make changes to this bug.
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