2017-11-13 13:42 GMT+03:00 Mark Thomas <ma...@apache.org>:
> On 13/11/17 09:49, Mark Thomas wrote:
>
> <snip/>
>
>> Hmm.
>>
>> As I started to look at this I realised that a large number of the
>> classes with errors are only using the static import a few times. Some
>> of them are using a mix of static and non-static imports.
>>
>> Given that switching to the non-static usage also fixes the issue, I'm
>> going to apply that fix first and then see what is left. Generally, I
>> plan to apply it when switching to the non-static usage results in
>> roughly the same amount of code or less.
>
> Given that:
>
> - the majority of the test classes don't use static imports
> - the majority of the test classes Gump is complaining about only use a
>   few static Asserts
> - only a small number of test classes use a large number of static
>   Asserts
> - global search and replace can remove all the static Assert imports
>   quickly and easily
> - removing static Asserts fixes the Checkstyle warnings for Gump and
>   works with all branches
>
> I'm going to go with removing static Assert (and similar) imports from
> the unit tests.
>

Honestly, I do not like this,
but this is not a technical issue, it is your itch, not worth to spend
much time discussing.

I think this reduces code readability, may surprise newcomers. (My
theory. One should ask a real newcomer.)

I think the trends in writing asserts are to use assertThat + Hamcrest
library matcher, and they look better with static imports.

https://github.com/junit-team/junit4/wiki/matchers-and-assertthat

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to