jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philippe Mouawad <philippe.moua...@gmail.com>
Subject Re: Checking values of properties more thoroughly
Date Sun, 16 Jul 2017 13:37:39 GMT
Hello,
Looks like a good idea.

First variant looks nicer to me too

Thanks

On Sun, Jul 16, 2017 at 3:13 PM, Felix Schumacher <
felix.schumacher@internetallee.de> wrote:

> While looking for easy enhancements and bugs I stumbled upon:
>
> https://bz.apache.org/bugzilla/show_bug.cgi?id=56862
>
> I have to admit, that the error messages for wrong values are not always
> that helpful. Especially, when those values are used very late.
>
> To help things, we could either add a validate function (lambda?) to the
> JMeterUtils#getPropDefault family of functions, or surround those calls by
> a validator.
>
> I was thinking of something like
>
>  private static int TIMEOUT = JMeterUtils.getPropDefault("some.timeout",
> 5 * 1000, i -> i >= 0);
>
>  private static int TIMEOUT = JMeterUtils.getPropDefault("some.timeout",
> 5 * 1000, Validator::notNegative);
>
> or
>
>  private static int TIMEOUT = Validator.notNegative(JMeterUt
> ils.getPropDefault("some.timeout", 5 * 1000), "some.timeout must not be
> negative");
>
> At the moment I prefer the first variants.
>
> What do you think?
>
> Felix
>
>


-- 
Cordialement.
Philippe Mouawad.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message