lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dawid Weiss <dawid.we...@cs.put.poznan.pl>
Subject Re: Odd test failures
Date Mon, 01 Sep 2014 19:54:50 GMT
> Just curious, is there any case where you might genuinely need non-final
> static members in a test class?

To be honest you shouldn't have any static initializers at all,
including final fields (unless they're really immutable, simple data
types). The reason for this is that static initializers (including
those for final field assignments) are invoked when the class is
initialized and this may be happening outside of the scope of the test
runner. @BeforeClass or class rules are the way to "properly"
initialize before-test-suite things.

D.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message