On 6 January 2015 at 12:45, sebb <[email protected]> wrote: > On 6 January 2015 at 08:25, Andrey Pokhilko <[email protected]> wrote: >> About modifying JMXses: >> >> As far as I understand how JMeter works, it applies the default (which >> is "false") when no configuration property provided. > > Yes, assuming that the default is correctly defined. > >> But then when it >> saves the JMX, it writes all the properties, including those with >> default values. > > That depends on how the code writes the values. > There is a property setter that takes a default value; if the value > matches the default, it removes the property instead of writing it. > > This is done to avoid cluttering up the JMX files, and to assist with > backwards compatibiity. > > See for example > > AuthManager.setClearEachIteration(boolean clear) > > Note that the same constant (DEFAULT_CLEAR_VALUE) is used for both get and > set. > It's vital that the same value is used for get and set - and the value > must never change.
Forgot to add that boolean properties are often read with getPropertyAsBoolean(String) This uses an implied default of false. Also that this rule currently only applies to new properties. Existing properties should be left as is for now. We might want to revisit that if we are sure that dropping the JMX entries cannot cause any compatibility issues. That has not been determined yet. But at least if the default entries are omitted for new properties, the JMX files won't get larger and larger. >> I did change to JMXses since somewhere in the tests there is a check >> that JMX must stay unchanged upon open and save. Yes, part of the point of those unit tests is to check for incompatibilities between versions. The JMX test files should hardly ever need changing. If an existing test starts failing when code is changed, then the most likely cause is a bug in the new code, not an error in the test case. Test cases should only be changed if it is clear that the test case is at fault rather than the code. >> If I'm wrong and there >> is some other way to make those tests passing, please tell it to me and >> I'll roll back the undesired changes. >> Please
