[jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-26 Thread Robert Muir (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12794629#action_12794629
 ] 

Robert Muir commented on LUCENE-2122:
-

Erick the test problems havent gone away (see latest hudson  failure), but as 
you can see they appear to be unrelated to your patch, but existing problems.

I am glad Uwe and Hudson are now seeing the failures I saw, but unfortunately I 
am unable to reproduce this problem. I think it is very wierd that it only 
recently has started happening and the Junit 4 jar file is looking very  
suspicious to me :)

The next step is to force another test failure (with existing trunk code), 
except with an additional assertion in TestQueryParser.getParser(), that 
asserts that the created queryparser has the same Locale as 
LocalizedTestcase.locale

If this assertion is not triggered, and a failure happens anyway, then there is 
no problem with LocalizedTestCase and we should commit your patch. This would 
mean the problem is instead some problem in the query parser, its tests, date 
calculations, jvm handling of thai dates, something else, but not the 
locale-switching.

if the assertion is triggered, then we need to figure how why before changing 
the locale-swapping mechanism.

I ran this test 2500 times last night but i couldnt make it fail. i have a very 
small portable right now and I will need to wait till the new year to really 
look at this more...


 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
Priority: Minor
 Fix For: 3.1

 Attachments: LUCENE-2122-r2.patch, LUCENE-2122-r3.patch, 
 LUCENE-2122-r4.patch, LUCENE-2122.patch, 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



[jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-26 Thread Uwe Schindler (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12794635#action_12794635
 ] 

Uwe Schindler commented on LUCENE-2122:
---

Some additional infos about the Hudson failure:
In the past Hudson used an internal junit.jar to do the testing, which was in 
version 4 (the exact version can only be found out by one with hudson access, 
Mike?). So Hudson was always using Junit4 for testing even in Lucene 2.9. After 
the clover updates, we removed this JUnit lib path from the ANT command line 
and therefore also hudson uses 4.7 as shipped with the svn checkout.

If it is really a JUnit problem, it seems to only occur with version 4.7. But I 
am not sure, I still stink it may be a thread starvation problem (slow test) or 
some local time problem that occurred two nights ago.

 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
Priority: Minor
 Fix For: 3.1

 Attachments: LUCENE-2122-r2.patch, LUCENE-2122-r3.patch, 
 LUCENE-2122-r4.patch, LUCENE-2122.patch, 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



[jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-26 Thread Robert Muir (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12794639#action_12794639
 ] 

Robert Muir commented on LUCENE-2122:
-

I would be curious to know the previous version of the junit jar file that 
Hudson was using, if anyone can figure this out. 

I do not want to quickly blame junit or jvm, etc, but its very suspicious that 
this only recently started happening, and only sporadically for thai locale 
with the query parser.

this will be a tricky one to figure out for sure.

 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
Priority: Minor
 Fix For: 3.1

 Attachments: LUCENE-2122-r2.patch, LUCENE-2122-r3.patch, 
 LUCENE-2122-r4.patch, LUCENE-2122.patch, 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



RE: [jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-13 Thread Uwe Schindler
Hi Erick,

 

sadly, the eMail reply to JIRA issues does not work for mails sent to this
mailing list (because the list overrides reply-to header so JIRA does not
get the answer). If you answer only on the ML, we loss those comments in the
issue.

 

Uwe

 

-
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de

  _  

From: Erick Erickson [mailto:erickerick...@gmail.com] 
Sent: Sunday, December 13, 2009 4:02 AM
To: java-dev@lucene.apache.org
Subject: Re: [jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more
thorough Locale testing for classes deriving from LocalizedTestCase

 

Robert:

The -r4 patch runs for you and you want me to look at your patch compared to
r4? Sure, I'll do that, but not til tomorrow, I do much better work when I'm
not tired G. 

I confess I haven't looked at your patch beyond installing it to see if I
could reproduce the failure (looks like our emails crossed). But it's
*still* peculiar that it behaves differently between our two machines. OTOH,
maybe your patch will fail on my machine sometime tonight, my 4 successes
aren't very statistically significant after all..

Erick

On Sat, Dec 12, 2009 at 9:14 PM, Robert Muir (JIRA) j...@apache.org wrote:


   [
https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.pl
ugin.system.issuetabpanels:comment-tabpanel
https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.p
lugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12789837#actio
n_12789837 focusedCommentId=12789837#action_12789837 ]

Robert Muir commented on LUCENE-2122:
-

btw, I left 'ant clean test' running in a loop and just checked it with this
patch, no problems.
so perhaps its my own incompetence. Erick can you take a look? Do you see
some obvious problem?


 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
Priority: Minor
 Fix For: 3.1

 Attachments: LUCENE-2122-r2.patch, LUCENE-2122-r3.patch,
LUCENE-2122-r4.patch, LUCENE-2122.patch, 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

 



Re: [jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-13 Thread Erick Erickson
Uwe:

Thanks, I'll remember that in the future



On Sun, Dec 13, 2009 at 5:31 AM, Uwe Schindler u...@thetaphi.de wrote:

  Hi Erick,



 sadly, the eMail reply to JIRA issues does not work for mails sent to this
 mailing list (because the list overrides reply-to header so JIRA does not
 get the answer). If you answer only on the ML, we loss those comments in the
 issue.



 Uwe



 -
 Uwe Schindler
 H.-H.-Meier-Allee 63, D-28213 Bremen
 http://www.thetaphi.de
 eMail: u...@thetaphi.de
   --

 *From:* Erick Erickson [mailto:erickerick...@gmail.com]
 *Sent:* Sunday, December 13, 2009 4:02 AM
 *To:* java-dev@lucene.apache.org
 *Subject:* Re: [jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for
 more thorough Locale testing for classes deriving from LocalizedTestCase



 Robert:

 The -r4 patch runs for you and you want me to look at your patch compared
 to r4? Sure, I'll do that, but not til tomorrow, I do much better work when
 I'm not tired G.

 I confess I haven't looked at your patch beyond installing it to see if I
 could reproduce the failure (looks like our emails crossed). But it's
 *still* peculiar that it behaves differently between our two machines. OTOH,
 maybe your patch will fail on my machine sometime tonight, my 4 successes
 aren't very statistically significant after all..

 Erick

 On Sat, Dec 12, 2009 at 9:14 PM, Robert Muir (JIRA) j...@apache.org
 wrote:


[
 https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12789837#action_12789837]

 Robert Muir commented on LUCENE-2122:
 -

 btw, I left 'ant clean test' running in a loop and just checked it with
 this patch, no problems.
 so perhaps its my own incompetence. Erick can you take a look? Do you see
 some obvious problem?


  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
 Priority: Minor
  Fix For: 3.1
 
  Attachments: LUCENE-2122-r2.patch, LUCENE-2122-r3.patch,
 LUCENE-2122-r4.patch, LUCENE-2122.patch, 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





[jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-12 Thread Robert Muir (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12789837#action_12789837
 ] 

Robert Muir commented on LUCENE-2122:
-

btw, I left 'ant clean test' running in a loop and just checked it with this 
patch, no problems.
so perhaps its my own incompetence. Erick can you take a look? Do you see some 
obvious problem?


 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
Priority: Minor
 Fix For: 3.1

 Attachments: LUCENE-2122-r2.patch, LUCENE-2122-r3.patch, 
 LUCENE-2122-r4.patch, LUCENE-2122.patch, 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



Re: [jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-12 Thread Erick Erickson
Robert:

The -r4 patch runs for you and you want me to look at your patch compared to
r4? Sure, I'll do that, but not til tomorrow, I do much better work when I'm
not tired G.

I confess I haven't looked at your patch beyond installing it to see if I
could reproduce the failure (looks like our emails crossed). But it's
*still* peculiar that it behaves differently between our two machines. OTOH,
maybe your patch will fail on my machine sometime tonight, my 4 successes
aren't very statistically significant after all..

Erick

On Sat, Dec 12, 2009 at 9:14 PM, Robert Muir (JIRA) j...@apache.org wrote:


[
 https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12789837#action_12789837]

 Robert Muir commented on LUCENE-2122:
 -

 btw, I left 'ant clean test' running in a loop and just checked it with
 this patch, no problems.
 so perhaps its my own incompetence. Erick can you take a look? Do you see
 some obvious problem?


  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
 Priority: Minor
  Fix For: 3.1
 
  Attachments: LUCENE-2122-r2.patch, LUCENE-2122-r3.patch,
 LUCENE-2122-r4.patch, LUCENE-2122.patch, 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




Re: [jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-11 Thread Erick Erickson
So I ran this test suite from Idea a dozen times or so and no problem.

Then I ran it a couple of thousand times through Ant via a shell
script. No problem.

So I'm tending toward thinking it's an Eclipse issue, what do
you think?

Erick


On Thu, Dec 10, 2009 at 4:23 PM, Erick Erickson erickerick...@gmail.comwrote:

 I'll give this a whirl tonight. The reason I was wondering what language
 is to insure that my machine *also* tests the offending locale.

 A bit of a nit, the flaw in the approach with LocalizedTestCase is
 that *every* test in the class is run against *all* locales..
 To change this, as I understand it, we'd need to break the tests
 out into a separate class...

 Intermittent errors often smell like a race condition, so I'll be
 on the lookout for one.

 But I also wonder if you'd ever get this error running outside
 of Eclipse.

 I really, really, really hate ones like this. Let's say you have a script
 that runs 1,000 times flawlessly from the shell. What does that prove?
 nasty grin.

 But maybe if I relentlessly press the test button on that class it'll
 happen
 to me too

 FWIW
 Erick

 On Thu, Dec 10, 2009 at 3:30 PM, Robert Muir rcm...@gmail.com wrote:

 i just right clicked TestQueryParser and said 'run as junit test'

 i could not tell which locales failed, (just testing your original patch,
 no modifications)
 the way they are shown instead is like an array of 135 elements...
 [0]: testCJK[0] (0.000s)
   testSimple[0] (0.001s)
 ...
 [1]: testCJK[1] (0.000s)
 ...
 [135] testCJK[135]

 the only tests that failed were the localized methods like the date stuff,
 where its going to create an 'expected' localized string and then compare
 against that.
 it makes me suspect that somehow there is some race, and the default
 locale is actually changing as the test is running, or something crazy like
 this?!



 On Thu, Dec 10, 2009 at 3:23 PM, Erick Erickson 
 erickerick...@gmail.comwrote:

 Yep, that sure makes me nervous too. I've never seen a failure in
 IntelliJ or from a
 shell window.

 How often do you need to run it to see an error? And what language is it
 using?
 And what test?

 I can try this in my IntelliJ setup and see if I can reproduce it. Note
 I'm running
 on a Macbook Pro...

 I wonder if a repeating script would show an intermittent error

 Erick


 On Thu, Dec 10, 2009 at 3:10 PM, Robert Muir (JIRA) j...@apache.orgwrote:


[
 https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=1274#action_1274]

 Robert Muir commented on LUCENE-2122:
 -

 Hi Erick, I played with this patch some and (not intentionally trying) I
 would get random test failures for TestQueryParser under eclipse... its not
 really something I am able to repeat though.

 maybe some race condition (I do not know how eclipse executes
 parameterized tests) ?

 if it is a problem with my IDE that is one thing, just makes me a little
 nervous right now. trying to think what could cause this

  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: Robert Muir
 Priority: Minor
  Fix For: 3.1
 
  Attachments: LUCENE-2122-r2.patch, LUCENE-2122-r3.patch,
 LUCENE-2122-r4.patch, 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





Re: [jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-10 Thread Robert Muir
thanks Erick, in this case we only need to worry about reporting failure, so
you know what locale your code does not work for.

for the other thing we can just run the default locale, then everything else
(including the default). This is how the current code works. The main thing
is that for example, if you are French and you write some date code that is
completely broken, its better to see the failure in your own locale before
you see a test failure in the Thai calendar or something like that.

On Wed, Dec 9, 2009 at 11:06 PM, Erick Erickson erickerick...@gmail.comwrote:

 It's embarrassing that I had to poke around for 1/2 hour to find *code that
 I had written recently*. siiiggghhh. Maybe this time it'll stick

 In LuceneTestCaseJ4, we added an @Rule-annotated class
 InterceptTestCaseEvents whose methods get called whenever an event
 happens, things like succeeded, failed, started, etc.. The failed method
 looks for a method in the failing class called reportAdditionalFailureInfo.
 So by adding something like the below to LocalizedTestCase you can print any
 information you have available whenever things fail. It gets printed in
 addition to the usual information Junit prints. Warning: I tested this
 *very* lightly, at least it worked in the one case I tried..

   @Override
   public void reportAdditionalFailureInfo() {
 System.out.println(Failing locale is +
 _currentLocale.getDisplayName(_origDefault));
 super.reportAdditionalFailureInfo(); // call to super.report.
 UNTESTED! and probably not necessary in this context. Left as an exercise
 for the reader G.
   }

 Currently this is only does extra stuff for failed cases, but it would be
 trivial to extend for start, end, succeeded whenever there's a need.

 Your second question seems quite do-able,just by putting the default locale
 in the list before getting into the loop as the first entry. I'm not sure
 removing the default language is worth the effort, so it gets run twice. But
 if you're writing the code, do whatever you want.

 Gotta get some sleep G...

 Erick


 On Wed, Dec 9, 2009 at 9:45 PM, Robert Muir (JIRA) j...@apache.orgwrote:


[
 https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12788455#action_12788455]

 Robert Muir commented on LUCENE-2122:
 -

 thanks Erick, i will play around with the patch some, generally just
 double-check the locale stuff is doing what we want, looks like it will.

 i havent tested yet, but looking at the code i have a few questions (i can
 try to add these to the patch just curious what you think):
 1. if a test fails under some locale, say th_TH, will junit 4 attempt to
 print this parameter out in some way so I know that it failed? If not do you
 know of a hack?
 2. i am thinking about reordering the locale array so that it tests the
 default one first. if you are trying to do some test-driven dev it might be
 strange if the test fails under a different locale first. I think this one
 is obvious, I will play with it to see how it behaves now.


  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: Robert Muir
 Priority: Minor
  Fix For: 3.1
 
  Attachments: LUCENE-2122-r2.patch, LUCENE-2122-r3.patch,
 LUCENE-2122-r4.patch, 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


[jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-10 Thread Robert Muir (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=1274#action_1274
 ] 

Robert Muir commented on LUCENE-2122:
-

Hi Erick, I played with this patch some and (not intentionally trying) I would 
get random test failures for TestQueryParser under eclipse... its not really 
something I am able to repeat though.

maybe some race condition (I do not know how eclipse executes parameterized 
tests) ? 

if it is a problem with my IDE that is one thing, just makes me a little 
nervous right now. trying to think what could cause this

 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: Robert Muir
Priority: Minor
 Fix For: 3.1

 Attachments: LUCENE-2122-r2.patch, LUCENE-2122-r3.patch, 
 LUCENE-2122-r4.patch, 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



Re: [jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-10 Thread Erick Erickson
Yep, that sure makes me nervous too. I've never seen a failure in IntelliJ
or from a
shell window.

How often do you need to run it to see an error? And what language is it
using?
And what test?

I can try this in my IntelliJ setup and see if I can reproduce it. Note I'm
running
on a Macbook Pro...

I wonder if a repeating script would show an intermittent error

Erick

On Thu, Dec 10, 2009 at 3:10 PM, Robert Muir (JIRA) j...@apache.org wrote:


[
 https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=1274#action_1274]

 Robert Muir commented on LUCENE-2122:
 -

 Hi Erick, I played with this patch some and (not intentionally trying) I
 would get random test failures for TestQueryParser under eclipse... its not
 really something I am able to repeat though.

 maybe some race condition (I do not know how eclipse executes parameterized
 tests) ?

 if it is a problem with my IDE that is one thing, just makes me a little
 nervous right now. trying to think what could cause this

  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: Robert Muir
 Priority: Minor
  Fix For: 3.1
 
  Attachments: LUCENE-2122-r2.patch, LUCENE-2122-r3.patch,
 LUCENE-2122-r4.patch, 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




Re: [jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-10 Thread Robert Muir
i just right clicked TestQueryParser and said 'run as junit test'

i could not tell which locales failed, (just testing your original patch, no
modifications)
the way they are shown instead is like an array of 135 elements...
[0]: testCJK[0] (0.000s)
  testSimple[0] (0.001s)
...
[1]: testCJK[1] (0.000s)
...
[135] testCJK[135]

the only tests that failed were the localized methods like the date stuff,
where its going to create an 'expected' localized string and then compare
against that.
it makes me suspect that somehow there is some race, and the default locale
is actually changing as the test is running, or something crazy like this?!


On Thu, Dec 10, 2009 at 3:23 PM, Erick Erickson erickerick...@gmail.comwrote:

 Yep, that sure makes me nervous too. I've never seen a failure in IntelliJ
 or from a
 shell window.

 How often do you need to run it to see an error? And what language is it
 using?
 And what test?

 I can try this in my IntelliJ setup and see if I can reproduce it. Note I'm
 running
 on a Macbook Pro...

 I wonder if a repeating script would show an intermittent error

 Erick


 On Thu, Dec 10, 2009 at 3:10 PM, Robert Muir (JIRA) j...@apache.orgwrote:


[
 https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=1274#action_1274]

 Robert Muir commented on LUCENE-2122:
 -

 Hi Erick, I played with this patch some and (not intentionally trying) I
 would get random test failures for TestQueryParser under eclipse... its not
 really something I am able to repeat though.

 maybe some race condition (I do not know how eclipse executes
 parameterized tests) ?

 if it is a problem with my IDE that is one thing, just makes me a little
 nervous right now. trying to think what could cause this

  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: Robert Muir
 Priority: Minor
  Fix For: 3.1
 
  Attachments: LUCENE-2122-r2.patch, LUCENE-2122-r3.patch,
 LUCENE-2122-r4.patch, 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


Re: [jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-10 Thread Erick Erickson
I'll give this a whirl tonight. The reason I was wondering what language
is to insure that my machine *also* tests the offending locale.

A bit of a nit, the flaw in the approach with LocalizedTestCase is
that *every* test in the class is run against *all* locales..
To change this, as I understand it, we'd need to break the tests
out into a separate class...

Intermittent errors often smell like a race condition, so I'll be
on the lookout for one.

But I also wonder if you'd ever get this error running outside
of Eclipse.

I really, really, really hate ones like this. Let's say you have a script
that runs 1,000 times flawlessly from the shell. What does that prove?
nasty grin.

But maybe if I relentlessly press the test button on that class it'll happen
to me too

FWIW
Erick

On Thu, Dec 10, 2009 at 3:30 PM, Robert Muir rcm...@gmail.com wrote:

 i just right clicked TestQueryParser and said 'run as junit test'

 i could not tell which locales failed, (just testing your original patch,
 no modifications)
 the way they are shown instead is like an array of 135 elements...
 [0]: testCJK[0] (0.000s)
   testSimple[0] (0.001s)
 ...
 [1]: testCJK[1] (0.000s)
 ...
 [135] testCJK[135]

 the only tests that failed were the localized methods like the date stuff,
 where its going to create an 'expected' localized string and then compare
 against that.
 it makes me suspect that somehow there is some race, and the default locale
 is actually changing as the test is running, or something crazy like this?!



 On Thu, Dec 10, 2009 at 3:23 PM, Erick Erickson 
 erickerick...@gmail.comwrote:

 Yep, that sure makes me nervous too. I've never seen a failure in IntelliJ
 or from a
 shell window.

 How often do you need to run it to see an error? And what language is it
 using?
 And what test?

 I can try this in my IntelliJ setup and see if I can reproduce it. Note
 I'm running
 on a Macbook Pro...

 I wonder if a repeating script would show an intermittent error

 Erick


 On Thu, Dec 10, 2009 at 3:10 PM, Robert Muir (JIRA) j...@apache.orgwrote:


[
 https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=1274#action_1274]

 Robert Muir commented on LUCENE-2122:
 -

 Hi Erick, I played with this patch some and (not intentionally trying) I
 would get random test failures for TestQueryParser under eclipse... its not
 really something I am able to repeat though.

 maybe some race condition (I do not know how eclipse executes
 parameterized tests) ?

 if it is a problem with my IDE that is one thing, just makes me a little
 nervous right now. trying to think what could cause this

  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: Robert Muir
 Priority: Minor
  Fix For: 3.1
 
  Attachments: LUCENE-2122-r2.patch, LUCENE-2122-r3.patch,
 LUCENE-2122-r4.patch, 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



[jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-09 Thread Robert Muir (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12788100#action_12788100
 ] 

Robert Muir commented on LUCENE-2122:
-

Hi Erick, in the Date tools test I think you can delete the public static 
CollectionLocale[] data(), I think you might have accidentally included it?


 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-r2.patch, LUCENE-2122-r3.patch, 
 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



Re: [jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-09 Thread Erick Erickson
Sh. I'll look at it again tonight

On Wed, Dec 9, 2009 at 9:13 AM, Robert Muir (JIRA) j...@apache.org wrote:


[
 https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12788100#action_12788100]

 Robert Muir commented on LUCENE-2122:
 -

 Hi Erick, in the Date tools test I think you can delete the public static
 CollectionLocale[] data(), I think you might have accidentally included
 it?


  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-r2.patch, LUCENE-2122-r3.patch,
 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




[jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-09 Thread Robert Muir (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12788455#action_12788455
 ] 

Robert Muir commented on LUCENE-2122:
-

thanks Erick, i will play around with the patch some, generally just 
double-check the locale stuff is doing what we want, looks like it will.

i havent tested yet, but looking at the code i have a few questions (i can try 
to add these to the patch just curious what you think):
1. if a test fails under some locale, say th_TH, will junit 4 attempt to print 
this parameter out in some way so I know that it failed? If not do you know of 
a hack?
2. i am thinking about reordering the locale array so that it tests the default 
one first. if you are trying to do some test-driven dev it might be strange if 
the test fails under a different locale first. I think this one is obvious, I 
will play with it to see how it behaves now.


 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: Robert Muir
Priority: Minor
 Fix For: 3.1

 Attachments: LUCENE-2122-r2.patch, LUCENE-2122-r3.patch, 
 LUCENE-2122-r4.patch, 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



Re: [jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-09 Thread Erick Erickson
It's embarrassing that I had to poke around for 1/2 hour to find *code that
I had written recently*. siiiggghhh. Maybe this time it'll stick

In LuceneTestCaseJ4, we added an @Rule-annotated class
InterceptTestCaseEvents whose methods get called whenever an event
happens, things like succeeded, failed, started, etc.. The failed method
looks for a method in the failing class called reportAdditionalFailureInfo.
So by adding something like the below to LocalizedTestCase you can print any
information you have available whenever things fail. It gets printed in
addition to the usual information Junit prints. Warning: I tested this
*very* lightly, at least it worked in the one case I tried..

  @Override
  public void reportAdditionalFailureInfo() {
System.out.println(Failing locale is +
_currentLocale.getDisplayName(_origDefault));
super.reportAdditionalFailureInfo(); // call to super.report.
UNTESTED! and probably not necessary in this context. Left as an exercise
for the reader G.
  }

Currently this is only does extra stuff for failed cases, but it would be
trivial to extend for start, end, succeeded whenever there's a need.

Your second question seems quite do-able,just by putting the default locale
in the list before getting into the loop as the first entry. I'm not sure
removing the default language is worth the effort, so it gets run twice. But
if you're writing the code, do whatever you want.

Gotta get some sleep G...

Erick

On Wed, Dec 9, 2009 at 9:45 PM, Robert Muir (JIRA) j...@apache.org wrote:


[
 https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12788455#action_12788455]

 Robert Muir commented on LUCENE-2122:
 -

 thanks Erick, i will play around with the patch some, generally just
 double-check the locale stuff is doing what we want, looks like it will.

 i havent tested yet, but looking at the code i have a few questions (i can
 try to add these to the patch just curious what you think):
 1. if a test fails under some locale, say th_TH, will junit 4 attempt to
 print this parameter out in some way so I know that it failed? If not do you
 know of a hack?
 2. i am thinking about reordering the locale array so that it tests the
 default one first. if you are trying to do some test-driven dev it might be
 strange if the test fails under a different locale first. I think this one
 is obvious, I will play with it to see how it behaves now.


  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: Robert Muir
 Priority: Minor
  Fix For: 3.1
 
  Attachments: LUCENE-2122-r2.patch, LUCENE-2122-r3.patch,
 LUCENE-2122-r4.patch, 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




[jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-06 Thread Robert Muir (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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



Re: [jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-06 Thread Erick Erickson
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-tabpanelfocusedCommentId=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




Re: [jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-06 Thread Robert Muir
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.comwrote:

 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.orgwrote:


[
 https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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


[jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-06 Thread Robert Muir (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12786757#action_12786757
 ] 

Robert Muir commented on LUCENE-2122:
-

Erick do you think LocalizedTestCase should be abstract?

 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-r2.patch, 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



Re: [jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-06 Thread Erick Erickson
Hmmm, you're probably right. There's no earthly
reason for a test writer to create an instance
of LocalizedTestCase, it has no use except as
a superclass by its nature even though it has
no abstract methods. So making it abstract will
server to flag that fact to anyone who tries
to instantiate it.

I'll change this too, hold off on applying this patch,
I'll wait for a bit to gather more comments and put
them all together in an r3 version.

Erick

On Sun, Dec 6, 2009 at 9:02 PM, Robert Muir (JIRA) j...@apache.org wrote:


[
 https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12786757#action_12786757]

 Robert Muir commented on LUCENE-2122:
 -

 Erick do you think LocalizedTestCase should be abstract?

  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-r2.patch, 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




Re: [jira] Commented: (LUCENE-2122) Use JUnit4 capabilites for more thorough Locale testing for classes deriving from LocalizedTestCase

2009-12-06 Thread Erick Erickson
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.comwrote:

 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.orgwrote:


[
 https://issues.apache.org/jira/browse/LUCENE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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