lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-2598) allow tests to use different Directory impls
Date Thu, 12 Aug 2010 05:32:16 GMT

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

Shai Erera commented on LUCENE-2598:
------------------------------------

Robert, how about if we use JUnit's TemporaryFolder (http://kentbeck.github.com/junit/javadoc/latest/org/junit/rules/TemporaryFolder.html)?
We can put it in LTC(J4) and have tests that wish to create on-disk resources use it. JUnit
guarantees the contents of this folder will be removed when the test is finished, and if the
test did not close its resources properly, it will fail. It will save us some code, nothing
we cannot develop on our own, as you suggest.

> allow tests to use different Directory impls
> --------------------------------------------
>
>                 Key: LUCENE-2598
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2598
>             Project: Lucene - Java
>          Issue Type: Test
>          Components: Build
>    Affects Versions: 3.1, 4.0
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>             Fix For: 3.1, 4.0
>
>
> Now that all tests use MockRAMDirectory instead of RAMDirectory, they are all picky like
windows and force our tests to
> close readers etc before closing the directory.
> I think we should do the following:
> # change new MockRAMDIrectory() in tests to .newDirectory(random)
> # LuceneTestCase[J4] tracks if all dirs are closed at tearDown and also cleans up temp
dirs like solr.
> # factor out the Mockish stuff from MockRAMDirectory into MockDirectoryWrapper
> # allow a -Dtests.directoryImpl or simpler to specify the default Directory to use for
tests: default being "random"
> i think theres a chance we might find some bugs that havent yet surfaced because they
are easier to trigger with FSDir
> Furthermore, this would be beneficial to Directory-implementors as they could run the
entire testsuite against their Directory impl, just like codec-implementors can do now.

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