On 25 February 2016 at 23:59, sebb <[email protected]> wrote:
> On 25 February 2016 at 22:36, Philippe Mouawad
> <[email protected]> wrote:
>> Hello,
>>
>> In JMeter we usually manage properties this way:
>>     public String getImplementation() {
>>         return getPropertyAsString(IMPLEMENTATION, DEFAULT_POLICY);
>>     }
>>
>>     public void setImplementation(String implementation){
>>         setProperty(IMPLEMENTATION, implementation, DEFAULT_POLICY);
>>     }
>>
>>
>> setProperty will not save in JMX the value if it is equal to DEFAULT_POLICY.
>> This is good for the size of JMX but it's an issue for migration when we
>> change default values in N+1 and load the JMX plan in this new plan.
>>
>> You can see an illustration through :
>> https://bz.apache.org/bugzilla/show_bug.cgi?id=58756#c2
>> --------------------------------------------------------------------------------------------------------------
>>
>> The issue is that when reading a 2.13 saved JMX from a 3.0, as default have
>> changed, the default values are not in JMX file so we end up initializing
>> different values.
>>
>> --------------------------------------------------------------------------------------------------------------
>>
>>
>> So I think we should abandon this practice in favor of explicit defaults.
>
> That is not necessary.
>
> If a default changes, just drop the default from the setProperty call.
> The value will then always be saved.

On reflection, although that works for new test plans it breaks
compatibility, as it changes the meaning of the original JMX files.

Once a default is established for the JMX, it should never be changed.

But this does not mean that we cannot change the default for *new*
test elements.

That is easy to do - just change the GUI code to use a different
default for the GUI field.

[Often the default is just the empty string, so it's perhaps not
obvious that it is the default.]

>> Second question, how can we fix this issue ?
>> upgrade.properties used by NameUpdater does some upgrade but not on default
>> values.

I suppose that would be a way to change the JMX defaults, but it would
mean more code/testing/maintenance merely to reduce the JMX size.

> As above.
>
>>
>> Thanks
>> Regards
>> Philippe M.
>> @philmdot

Reply via email to