Well, under any circumstances, the line
Locale.setDefault(Locale.getDefault());
was just plain silly. At the cost of setting the
default locale exactly once per test *class*
(I used @BeforeClass/@AfterClass), I'd
far rather err on the side of paranoia than
cause someone to spend *hours* figuring
it out...


On Sun, Dec 6, 2009 at 8:41 PM, Robert Muir <rcm...@gmail.com> wrote:

> Erick, btw I may not be right about this... certainly if you are invoking
> each test in its own JVM it should be no problem... its just some paranoia.
>
> also this same "changing of JRE-system wide variable" would prevent these
> tests from being parallelized in the same jvm, in case that matters... (they
> should run in their own jvm sequentially)
>
> LocalizedTestCase is nasty, I admit, but it works and prevents hours of
> changing variables and running ant test under different locales... just one
> of those things
>
> thanks for tackling this one
>
>
> On Sun, Dec 6, 2009 at 8:30 PM, Erick Erickson <erickerick...@gmail.com>wrote:
>
>> I just made a comment on how many times
>> I've made the "that looks unnecessary, I'll
>> take it out" mistake. Now I get to add one to
>> that total.
>>
>> I'll attach a revised patch momentarily with this
>> change.
>>
>> Thanks for pointing this out!
>>
>> Erick
>>
>>
>> On Sun, Dec 6, 2009 at 8:00 PM, Robert Muir (JIRA) <j...@apache.org>wrote:
>>
>>>
>>>    [
>>> https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12786749#action_12786749]
>>>
>>> Robert Muir commented on LUCENE-2122:
>>> -------------------------------------
>>>
>>> Hi Erick, I am a little nervous about the change to
>>> LocalizedTestCase.tearDown() here.
>>>
>>> I think we must restore the users default Locale, since its a JRE-system
>>> wide global thing and we are changing it on the fly here.
>>>
>>> this was stashed away here before:
>>> {code}
>>>  /**
>>>   * Before changing the default Locale, save the default Locale here so
>>> that it
>>>   * can be restored.
>>>   */
>>>  private final Locale defaultLocale = Locale.getDefault();
>>> {code}
>>>
>>> and restored in tearDown()... otherwise strange things could happen, such
>>> as your IDE could go bonkers after running the tests! (but maybe I am
>>> missing something)
>>>
>>> > Use JUnit4 capabilites for more thorough Locale testing for classes
>>> deriving from LocalizedTestCase
>>> >
>>> ---------------------------------------------------------------------------------------------------
>>> >
>>> >                 Key: LUCENE-2122
>>> >                 URL: https://issues.apache.org/jira/browse/LUCENE-2122
>>> >             Project: Lucene - Java
>>> >          Issue Type: Improvement
>>> >          Components: Other
>>> >    Affects Versions: 3.1
>>> >            Reporter: Erick Erickson
>>> >            Assignee: Erick Erickson
>>> >            Priority: Minor
>>> >             Fix For: 3.1
>>> >
>>> >         Attachments: LUCENE-2122.patch
>>> >
>>> >
>>> > Use the @Parameterized capabilities of Junit4 to allow more extensive
>>> testing of Locales.
>>>
>>> --
>>> This message is automatically generated by JIRA.
>>> -
>>> You can reply to this email to add a comment to the issue online.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
>>> For additional commands, e-mail: java-dev-h...@lucene.apache.org
>>>
>>>
>>
>
>
> --
> Robert Muir
> rcm...@gmail.com
>

Reply via email to