Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Protect against setting sys properties in TimeZone.getDefault().

Dawid Weiss6e7c2c441b2e
diff --git a/lucene/core/src/test/org/apache/lucene/document/TestDateTools.java b/lucene/core/src/test/org/apache/lucene/document/TestDateTools.java
index be6fb931477..7f2afa4e406 100644
--- a/lucene/core/src/test/org/apache/lucene/document/TestDateTools.java
+++ b/lucene/core/src/test/org/apache/lucene/document/TestDateTools.java
@@ -9,6 +9,10 @@ import java.util.TimeZone;
import java.util.Locale;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.SystemPropertiesRestoreRule;
+import org.junit.Rule;
+import org.junit.rules.RuleChain;
+import org.junit.rules.TestRule;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -27,6 +31,9 @@ import org.apache.lucene.util.LuceneTestCase;
* limitations under the License.
*/
public class TestDateTools extends LuceneTestCase {
+ @Rule
+ public TestRule testRules =
+ RuleChain.outerRule(new SystemPropertiesRestoreRule());
public void testStringToDate() throws ParseException {