You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Uwe Schindler (JIRA)" <ji...@apache.org> on 2010/03/14 12:31:27 UTC
[jira] Updated: (LUCENE-2318) Add System.getProperty("tempDir") as
final static to LuceneTestCase(J4)
[ https://issues.apache.org/jira/browse/LUCENE-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Uwe Schindler updated LUCENE-2318:
----------------------------------
Attachment: LUCENE-2318.patch
Here the patch.
I removed almost all System.getProperty calls from tests. Only remaining are the special properties in benchmark (maybe that can be solved, too) and System.getProperty("line.separator") - but that's fine.
LuceneTestCaseJ4 now has two fields of type java.io.File:
- TEMP_DIR that is retrieved from system property "tempDir", set by ANT or, if not available from "java.io.tmpdir". By this tests will also run correctly from eclipse. This is static.
- DATA_DIR (deprecated) that is used by some contrib tests. This should not be used, instead the tests should use this.getClass().getResource/getResourceAsStream, which is also relative to the current tests. I did not change the tests to use this. DATA_DIR is detected from system property (set by ANT), else it is loaded from classpath of the *current* test class, because of that it is not static (but final) and initialized in the class ctor.
> Add System.getProperty("tempDir") as final static to LuceneTestCase(J4)
> -----------------------------------------------------------------------
>
> Key: LUCENE-2318
> URL: https://issues.apache.org/jira/browse/LUCENE-2318
> Project: Lucene - Java
> Issue Type: Test
> Reporter: Uwe Schindler
> Assignee: Uwe Schindler
> Fix For: 3.1
>
> Attachments: LUCENE-2318.patch
>
>
> Almost every test calls System.getProperty("tempDir") and some of them check the return value for null. In other cases the test simply fails from within eclipse.
> We should add this to LuceneTestCase(J4) as a static final constant. For enabling tests run in eclipse, we can add a fallback to ".", if the Sysprop is not defined.
--
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-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org