lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-2570) Some improvements to _TestUtil and its usage
Date Tue, 27 Jul 2010 10:50:16 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-2570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12892716#action_12892716
] 

Robert Muir commented on LUCENE-2570:
-------------------------------------

the only comment i have is exposing TEST_CODEC as public... can it be private? 

I don't think its very useful since it could be a value like "random" (and is by default!)
which isnt actually a valid codec, its basically just internal to LuceneTestCase[J4]

> Some improvements to _TestUtil and its usage
> --------------------------------------------
>
>                 Key: LUCENE-2570
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2570
>             Project: Lucene - Java
>          Issue Type: Test
>            Reporter: Shai Erera
>            Assignee: Shai Erera
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: LUCENE-2570.patch
>
>
> I've started this issue because I've noticed that _TestUtil.getRandomMultiplier() is
called from many loops' condition check, sometimes hundreds and thousands of times. Each time
it does Integer.parseInt after calling System.getProperty. This really can become a constant
IMO, either in LuceneTestCase(J4) or _TestUtil, as it's not expected to change while tests
are running ...
> I then reviewed the class and spotted some more things that I think can be fixed/improved:
> # getTestCodec() can become a constant as well
> # arrayToString is marked deprecated. I've checked an no one calls them, so I'll delete
them. This is a 4.0 code branch + a test-only class. No need to deprecate anything.
> # getTempDir calls new Random(), instead of newRandom() in LuceneTestCaseJ4, which means
that if something fails, we won't know the random seed used ...
> #* In that regard, we might want to output all the classes that obtained a static seed
in reportAdditionalFailures(), instead of just the class that ran the test.
> # rmDir(String) can be removed IMO, and leave only rmDir(File)
> # I suggest we include some recursion in rmDir(File) to handle the deletion of nested
directories.
> #* Also, it does not check whether the dir deletion itself succeeds (but it does so for
the files). This can bite us on Windows, if some test did not close things properly.
> I'll work out a patch.

-- 
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message