From e30c1307ee5a1451d269b54823d8dec45866c18c Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Fri, 27 Aug 2010 16:15:00 +0000 Subject: [PATCH] add missing javadoc to base test classes git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@990189 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/util/LuceneTestCase.java | 15 +++++++++++++++ .../org/apache/lucene/util/LuceneTestCaseJ4.java | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java b/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java index abc5b266f35..bbe8dbfc872 100644 --- a/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java +++ b/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java @@ -333,6 +333,16 @@ public abstract class LuceneTestCase extends TestCase { return LuceneTestCaseJ4.newIndexWriterConfig(r, v, a); } + /** + * Returns a new Dictionary instance. Use this when the test does not + * care about the specific Directory implementation (most tests). + *

+ * The Directory is wrapped with {@link MockDirectoryWrapper}. + * By default this means it will be picky, such as ensuring that you + * properly close it and all open files in your test. It will emulate + * some features of Windows, such as not allowing open files to be + * overwritten. + */ public MockDirectoryWrapper newDirectory(Random r) throws IOException { StackTraceElement[] stack = new Exception().getStackTrace(); Directory impl = LuceneTestCaseJ4.newDirectoryImpl(r, TEST_DIRECTORY); @@ -341,6 +351,11 @@ public abstract class LuceneTestCase extends TestCase { return dir; } + /** + * Returns a new Dictionary instance, with contents copied from the + * provided directory. See {@link #newDirectory(Random)} for more + * information. + */ public MockDirectoryWrapper newDirectory(Random r, Directory d) throws IOException { StackTraceElement[] stack = new Exception().getStackTrace(); Directory impl = LuceneTestCaseJ4.newDirectoryImpl(r, TEST_DIRECTORY); diff --git a/lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java b/lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java index 04a7728f2ee..76002f9f8d8 100644 --- a/lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java +++ b/lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java @@ -591,6 +591,16 @@ public class LuceneTestCaseJ4 { return c; } + /** + * Returns a new Dictionary instance. Use this when the test does not + * care about the specific Directory implementation (most tests). + *

+ * The Directory is wrapped with {@link MockDirectoryWrapper}. + * By default this means it will be picky, such as ensuring that you + * properly close it and all open files in your test. It will emulate + * some features of Windows, such as not allowing open files to be + * overwritten. + */ public static MockDirectoryWrapper newDirectory(Random r) throws IOException { StackTraceElement[] stack = new Exception().getStackTrace(); Directory impl = newDirectoryImpl(r, TEST_DIRECTORY); @@ -599,6 +609,11 @@ public class LuceneTestCaseJ4 { return dir; } + /** + * Returns a new Dictionary instance, with contents copied from the + * provided directory. See {@link #newDirectory(Random)} for more + * information. + */ public static MockDirectoryWrapper newDirectory(Random r, Directory d) throws IOException { StackTraceElement[] stack = new Exception().getStackTrace(); Directory impl = newDirectoryImpl(r, TEST_DIRECTORY);