lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: testing with system properties
Date Fri, 10 Aug 2018 00:12:50 GMT
See TestSolrXml.java for an example of:

@Rule
public TestRule solrTestRules = RuleChain.outerRule(new
SystemPropertiesRestoreRule());

Best,
Erick

On Thu, Aug 9, 2018 at 2:33 PM, Michael Sokolov <msokolov@gmail.com> wrote:
> I ran into a need to test some functionality that relies on system
> properties. Writing the test was error-prone because the properties persist
> across the jvm so if you set them in a test they leak across to other tests
> unless you are careful about @After methods. It occurred to me it would be
> nice if LuceneTestCase would detect this and yell. It could save all the
> system properties before each test (or at least each test class) and see if
> they are restored at the end.  I don't know if this arises much in Lucene,
> but maybe in Solr?
>
> -Mike

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


Mime
View raw message