From 6e7c2c441b2e11502863255f4d2ba4f5d269591b Mon Sep 17 00:00:00 2001 From: Dawid Weiss Date: Mon, 5 Mar 2012 07:58:06 +0000 Subject: [PATCH] Protect against setting sys properties in TimeZone.getDefault(). git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1296952 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/org/apache/lucene/document/TestDateTools.java | 7 +++++++ 1 file changed, 7 insertions(+) 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 {