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
This commit is contained in:
Dawid Weiss 2012-03-05 07:58:06 +00:00
parent 4b31375b55
commit 6e7c2c441b
1 changed files with 7 additions and 0 deletions

View File

@ -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 {