jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jørgen Austvik <jaust...@acm.org>
Subject Re: CSV Data Set Config not expanded in JUnit Constructors
Date Tue, 15 Jan 2013 07:50:38 GMT
Hi,

I have experimented more with this myself, and it seems the CSV Data
Set behaves as I thought, but that the JUnit Sampler works kind of
strange:
- Without "Create a new instance per sample", the object used are
constructed before the variables are set (probably before the test
iterations mentioned below?). The constructor does not get the
settings
- If I tick "Create a new instance per sample", the object gets
constructed with the variables set because it is constructed inside
the loop.
- The constructor is called even if I call a @BeforeClass static method
- Without "Create a new instance per sample", the constructor is
called even if the sampler is inside an if sentence which is not true

Behaviour I think makes sence
- Do not construct object if the method is static
- "Create a new instance per sample" should work as now
- When "Create a new instance per sample" is not set: Create a
ThreadLocal variable that is initiated on first usage (will get
correct constructor variables, will not be created unless it is needed
inside som if)

Best regards,
Jørgen

> See http://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config
>
> "CSV Dataset variables are defined at the start of each test
> iteration. As this is after configuration processing is completed,
> they cannot be used for some configuration items - such as JDBC Config
> - that process their contents at configuration time (see Bug 40394 )
> However the variables do work in the HTTP Auth Manager, as the
> username etc are processed at run-time. "

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Mime
View raw message