jmeter-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 61760] New function : isVarDefined
Date Wed, 15 Nov 2017 20:03:54 GMT

--- Comment #4 from Philippe Mouawad <> ---
(In reply to Graham Russell from comment #3)
> I think that in general having flags to change function behaviour can be
> confusing, if they are boolean, what do they mean (when reading the code)
> and if they are strings or something, how do we find out what we should use?

Function Helper Dialog can describe this.
We could use a mode instead of boolean.

> I presume most of the time you don't care if it's a var or property?

Not sure. User may have named by error a property and a variable the same.

> I think that simply, __isDefined(varOrPropName) is best, unless more complex
> knowledge is required.
> If vars and props can have the same name and you care about only the one
> being defined, how about:
> __isVarDefined(name)
> __isPropDefined(name)

Yes, my idea was just to avoid having too many functions.
> or if they cannot have the same name, maybe:
> __isDefined(varOrPropName) - true or false if var or prop is defined
> and

This name is already taken by jmeter-plugins functions.

> __isVar(name) and __isProp(name) if you then care about the difference once
> you've done but this wouldn't work very well if both are defined and you are
> trying to find out which is defined, but that doesn't seem to be the use
> case here anyway.

But intuitively, I would say that this function tells me if name is a property
or a variable, not if it's defined.

So I would end up to the following:

- Option 1 : isVarDefined / isPropDefined
- Option 2 : isSet(MODE, name), where mode is Property, Variable

Except for the additional function I feel Option 1 is better

You are receiving this mail because:
You are the assignee for the bug.
View raw message