Class LuceneTestCase
LUCENENET specific extensions to LuceneTestCase to make it easier to port tests
from Java with fewer changes.
Inheritance
System.Object
LuceneTestCase
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Lucene.Net.TestFramework.dll
Syntax
[TestFixture]
public abstract class LuceneTestCase
Fields
|
Improve this Doc
View Source
DEFAULT_LINE_DOCS_FILE
Declaration
public static readonly string DEFAULT_LINE_DOCS_FILE
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
INFOSTREAM
Declaration
public static readonly bool INFOSTREAM
Field Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
JENKINS_LARGE_LINE_DOCS_FILE
Declaration
public static readonly string JENKINS_LARGE_LINE_DOCS_FILE
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
LEAVE_TEMPORARY
Leave temporary files on disk, even on successful runs.
Declaration
public static readonly bool LEAVE_TEMPORARY
Field Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
RANDOM_MULTIPLIER
A random multiplier which you should use when writing random tests:
multiply it by the number of iterations to scale your tests (for nightly builds).
Declaration
public static readonly int RANDOM_MULTIPLIER
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Suite failure marker (any error in the test or suite scope).
Declaration
public static readonly bool SuiteFailureMarker
Field Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TEST_CODEC
Gets the codec to run tests with.
Declaration
public static readonly string TEST_CODEC
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
TEST_DIRECTORY
Gets the directory to run tests with
Declaration
public static readonly string TEST_DIRECTORY
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
Gets the docValuesFormat to run tests with
Declaration
public static readonly string TEST_DOCVALUESFORMAT
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
TEST_LINE_DOCS_FILE
The line file used by LineFileDocs
Declaration
public static readonly string TEST_LINE_DOCS_FILE
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
TEST_POSTINGSFORMAT
Gets the postingsFormat to run tests with.
Declaration
public static readonly string TEST_POSTINGSFORMAT
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
TEST_VERSION_CURRENT
Use this constant when creating Analyzers and any other version-dependent stuff.
NOTE: Change this when development starts for new Lucene version:
Declaration
public static readonly LuceneVersion TEST_VERSION_CURRENT
Field Value
|
Improve this Doc
View Source
VERBOSE
True if and only if tests are run in verbose mode. If this flag is false
tests are not expected to print any messages.
Declaration
public static readonly bool VERBOSE
Field Value
Type |
Description |
System.Boolean |
|
Properties
|
Improve this Doc
View Source
CodecFactory
Declaration
public static ICodecFactory CodecFactory { get; set; }
Property Value
|
Improve this Doc
View Source
DefaultCodecSupportsDocsWithField
Returns true if the codec "supports" docsWithField
(other codecs return MatchAllBits, because you couldnt write missing values before)
Declaration
public static bool DefaultCodecSupportsDocsWithField { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
DefaultCodecSupportsDocValues
Declaration
public static bool DefaultCodecSupportsDocValues { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
DefaultCodecSupportsFieldUpdates
Returns true if the codec "supports" field updates.
Declaration
public static bool DefaultCodecSupportsFieldUpdates { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
DefaultCodecSupportsMissingDocValues
Returns true if the default codec supports single valued docvalues with missing values
Declaration
public static bool DefaultCodecSupportsMissingDocValues { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
DefaultCodecSupportsSortedSet
Returns true if the default codec supports SORTED_SET docvalues
Declaration
public static bool DefaultCodecSupportsSortedSet { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Declaration
public static IDocValuesFormatFactory DocValuesFormatFactory { get; set; }
Property Value
|
Improve this Doc
View Source
DoesntSupportOffsets
Declaration
protected static ICollection<string> DoesntSupportOffsets { get; }
Property Value
Type |
Description |
System.Collections.Generic.ICollection<System.String> |
|
|
Improve this Doc
View Source
When true
, Codecs for old Lucene version will support writing
indexes in that format. Defaults to false
, can be disabled by
specific tests on demand.
This is a Lucene.NET INTERNAL API, use at your own risk
Declaration
public static bool OldFormatImpersonationIsActive { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
PostingsFormatFactory
Declaration
public static IPostingsFormatFactory PostingsFormatFactory { get; set; }
Property Value
|
Improve this Doc
View Source
Random
Access to the current System.Random instance. It is safe to use
this method from multiple threads, etc., but it should be called while within a runner's
scope (so no static initializers). The returned System.Random instance will be
different when this method is called inside a BeforeClass() hook (static
suite scope) and within NUnit.Framework.SetUpAttribute/ NUnit.Framework.TearDownAttribute hooks or test methods.
The returned instance must not be shared with other threads or cross a single scope's
boundary. For example, a System.Random acquired within a test method shouldn't be reused
for another test case.
There is an overhead connected with getting the System.Random for a particular context
and thread. It is better to cache the System.Random locally if tight loops with multiple
invocations are present or create a derivative local System.Random for millions of calls
like this:
Random random = new Random(Random.Next());
// tight loop with many invocations.
Declaration
public static Random Random { get; }
Property Value
Type |
Description |
System.Random |
|
|
Improve this Doc
View Source
TestName
Return the name of the currently executing test case.
Declaration
public virtual string TestName { get; }
Property Value
Type |
Description |
System.String |
|
Methods
|
Improve this Doc
View Source
AfterClass()
Tears down random defaults and cleans up temporary files.
If you override this method, be sure to call base.AfterClass()
AFTER
tearing down your test fixture.
Declaration
[OneTimeTearDown]
public virtual void AfterClass()
|
Improve this Doc
View Source
AssertDeletedDocsEquals(String, IndexReader, IndexReader)
Declaration
public virtual void AssertDeletedDocsEquals(string info, IndexReader leftReader, IndexReader rightReader)
Parameters
|
Improve this Doc
View Source
AssertDocsAndPositionsEnumEquals(String, DocsAndPositionsEnum, DocsAndPositionsEnum)
Checks docs + freqs + positions + payloads, sequentially.
Declaration
public virtual void AssertDocsAndPositionsEnumEquals(string info, DocsAndPositionsEnum leftDocs, DocsAndPositionsEnum rightDocs)
Parameters
|
Improve this Doc
View Source
AssertDocsEnumEquals(String, DocsEnum, DocsEnum, Boolean)
Checks docs + freqs, sequentially.
Declaration
public virtual void AssertDocsEnumEquals(string info, DocsEnum leftDocs, DocsEnum rightDocs, bool hasFreqs)
Parameters
Type |
Name |
Description |
System.String |
info |
|
DocsEnum |
leftDocs |
|
DocsEnum |
rightDocs |
|
System.Boolean |
hasFreqs |
|
|
Improve this Doc
View Source
AssertDocsSkippingEquals(String, IndexReader, Int32, DocsEnum, DocsEnum, Boolean)
Declaration
public virtual void AssertDocsSkippingEquals(string info, IndexReader leftReader, int docFreq, DocsEnum leftDocs, DocsEnum rightDocs, bool hasFreqs)
Parameters
Type |
Name |
Description |
System.String |
info |
|
IndexReader |
leftReader |
|
System.Int32 |
docFreq |
|
DocsEnum |
leftDocs |
|
DocsEnum |
rightDocs |
|
System.Boolean |
hasFreqs |
|
|
Improve this Doc
View Source
AssertDocValuesEquals(String, IndexReader, IndexReader)
Checks that docvalues across all fields are equivalent.
Declaration
public virtual void AssertDocValuesEquals(string info, IndexReader leftReader, IndexReader rightReader)
Parameters
|
Improve this Doc
View Source
AssertDocValuesEquals(String, Int32, NumericDocValues, NumericDocValues)
Declaration
public virtual void AssertDocValuesEquals(string info, int num, NumericDocValues leftDocValues, NumericDocValues rightDocValues)
Parameters
|
Improve this Doc
View Source
AssertFieldInfosEquals(String, IndexReader, IndexReader)
Declaration
public virtual void AssertFieldInfosEquals(string info, IndexReader leftReader, IndexReader rightReader)
Parameters
|
Improve this Doc
View Source
AssertFieldsEquals(String, IndexReader, Fields, Fields, Boolean)
Declaration
public virtual void AssertFieldsEquals(string info, IndexReader leftReader, Fields leftFields, Fields rightFields, bool deep)
Parameters
Type |
Name |
Description |
System.String |
info |
|
IndexReader |
leftReader |
|
Fields |
leftFields |
|
Fields |
rightFields |
|
System.Boolean |
deep |
|
|
Improve this Doc
View Source
AssertFieldStatisticsEquals(String, Fields, Fields)
Checks that top-level statistics on Fields are the same.
Declaration
public virtual void AssertFieldStatisticsEquals(string info, Fields leftFields, Fields rightFields)
Parameters
Type |
Name |
Description |
System.String |
info |
|
Fields |
leftFields |
|
Fields |
rightFields |
|
|
Improve this Doc
View Source
AssertNormsEquals(String, IndexReader, IndexReader)
Checks that norms are the same across all fields.
Declaration
public virtual void AssertNormsEquals(string info, IndexReader leftReader, IndexReader rightReader)
Parameters
|
Improve this Doc
View Source
AssertPositionsSkippingEquals(String, IndexReader, Int32, DocsAndPositionsEnum, DocsAndPositionsEnum)
Checks advancing docs + positions.
Declaration
public virtual void AssertPositionsSkippingEquals(string info, IndexReader leftReader, int docFreq, DocsAndPositionsEnum leftDocs, DocsAndPositionsEnum rightDocs)
Parameters
|
Improve this Doc
View Source
AssertReaderEquals(String, IndexReader, IndexReader)
Declaration
public virtual void AssertReaderEquals(string info, IndexReader leftReader, IndexReader rightReader)
Parameters
|
Improve this Doc
View Source
AssertReaderStatisticsEquals(String, IndexReader, IndexReader)
Checks that reader-level statistics are the same.
Declaration
public virtual void AssertReaderStatisticsEquals(string info, IndexReader leftReader, IndexReader rightReader)
Parameters
|
Improve this Doc
View Source
AssertSaneFieldCaches(String)
Asserts that FieldCacheSanityChecker does not detect any
problems with DEFAULT.
If any problems are found, they are logged to Error
(allong with the msg) when the Assertion is thrown.
This method is called by TearDown() after every test method,
however IndexReaders scoped inside test methods may be garbage
collected prior to this method being called, causing errors to
be overlooked. Tests are encouraged to keep their IndexReaders
scoped at the class level, or to explicitly call this method
directly in the same scope as the IndexReader.
Declaration
protected static void AssertSaneFieldCaches(string msg)
Parameters
Type |
Name |
Description |
System.String |
msg |
|
See Also
|
Improve this Doc
View Source
AssertStoredFieldEquals(String, IIndexableField, IIndexableField)
Checks that two stored fields are equivalent.
Declaration
public virtual void AssertStoredFieldEquals(string info, IIndexableField leftField, IIndexableField rightField)
Parameters
|
Improve this Doc
View Source
AssertStoredFieldsEquals(String, IndexReader, IndexReader)
Checks that stored fields of all documents are the same.
Declaration
public virtual void AssertStoredFieldsEquals(string info, IndexReader leftReader, IndexReader rightReader)
Parameters
|
Improve this Doc
View Source
AssertTermsEnumEquals(String, IndexReader, TermsEnum, TermsEnum, Boolean)
Checks the terms enum sequentially.
If deep
is false, it does a 'shallow' test that doesnt go down to the docsenums.
Declaration
public virtual void AssertTermsEnumEquals(string info, IndexReader leftReader, TermsEnum leftTermsEnum, TermsEnum rightTermsEnum, bool deep)
Parameters
|
Improve this Doc
View Source
AssertTermsEquals(String, IndexReader, Terms, Terms, Boolean)
Declaration
public virtual void AssertTermsEquals(string info, IndexReader leftReader, Terms leftTerms, Terms rightTerms, bool deep)
Parameters
Type |
Name |
Description |
System.String |
info |
|
IndexReader |
leftReader |
|
Terms |
leftTerms |
|
Terms |
rightTerms |
|
System.Boolean |
deep |
|
|
Improve this Doc
View Source
AssertTermsStatisticsEquals(String, Terms, Terms)
Checks collection-level statistics on Terms.
Declaration
public virtual void AssertTermsStatisticsEquals(string info, Terms leftTerms, Terms rightTerms)
Parameters
Type |
Name |
Description |
System.String |
info |
|
Terms |
leftTerms |
|
Terms |
rightTerms |
|
|
Improve this Doc
View Source
AssertTermStatsEquals(String, TermsEnum, TermsEnum)
Checks term-level statistics.
Declaration
public virtual void AssertTermStatsEquals(string info, TermsEnum leftTermsEnum, TermsEnum rightTermsEnum)
Parameters
|
Improve this Doc
View Source
AssertTermVectorsEquals(String, IndexReader, IndexReader)
Checks that term vectors across all fields are equivalent.
Declaration
public virtual void AssertTermVectorsEquals(string info, IndexReader leftReader, IndexReader rightReader)
Parameters
|
Improve this Doc
View Source
AsSet(Object[])
Return args
as a System.Collections.Generic.ISet<T> instance. The order of elements is not
preserved in enumerators.
Declaration
public static ISet<object> AsSet(params object[] args)
Parameters
Type |
Name |
Description |
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.ISet<System.Object> |
|
|
Improve this Doc
View Source
AssumeFalse(String, Boolean)
Declaration
public static void AssumeFalse(string msg, bool condition)
Parameters
Type |
Name |
Description |
System.String |
msg |
|
System.Boolean |
condition |
|
|
Improve this Doc
View Source
AssumeNoException(String, Exception)
Declaration
public static void AssumeNoException(string msg, Exception e)
Parameters
Type |
Name |
Description |
System.String |
msg |
|
System.Exception |
e |
|
|
Improve this Doc
View Source
AssumeTrue(String, Boolean)
Declaration
public static void AssumeTrue(string msg, bool condition)
Parameters
Type |
Name |
Description |
System.String |
msg |
|
System.Boolean |
condition |
|
|
Improve this Doc
View Source
AtLeast(Int32)
Declaration
public static int AtLeast(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
AtLeast(Random, Int32)
Returns a number of at least i
The actual number returned will be influenced by whether Lucene.Net.Util.LuceneTestCase.TEST_NIGHTLY
is active and RANDOM_MULTIPLIER, but also with some random fudge.
Declaration
public static int AtLeast(Random random, int i)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
System.Int32 |
i |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
BeforeClass()
Sets up dependency injection of codec factories for running the test class,
and also picks random defaults for culture, time zone, similarity, and default codec.
If you override this method, be sure to call base.BeforeClass()
BEFORE setting
up your test fixture.
Declaration
[OneTimeSetUp]
public virtual void BeforeClass()
|
Improve this Doc
View Source
CreateTempDir()
Creates an empty, temporary folder (when the name of the folder is of no importance).
Declaration
public static DirectoryInfo CreateTempDir()
Returns
Type |
Description |
System.IO.DirectoryInfo |
|
See Also
|
Improve this Doc
View Source
CreateTempDir(String)
Creates an empty, temporary folder with the given name prefix under the
system's System.IO.Path.GetTempPath.
The folder will be automatically removed after the
test class completes successfully. The test should close any file handles that would prevent
the folder from being removed.
Declaration
public static DirectoryInfo CreateTempDir(string prefix)
Parameters
Type |
Name |
Description |
System.String |
prefix |
|
Returns
Type |
Description |
System.IO.DirectoryInfo |
|
|
Improve this Doc
View Source
CreateTempFile()
Creates an empty temporary file.
Declaration
public static FileInfo CreateTempFile()
Returns
Type |
Description |
System.IO.FileInfo |
|
See Also
|
Improve this Doc
View Source
CreateTempFile(String, String)
Creates an empty file with the given prefix and suffix under the
system's System.IO.Path.GetTempPath.
The file will be automatically removed after the
test class completes successfully. The test should close any file handles that would prevent
the folder from being removed.
Declaration
public static FileInfo CreateTempFile(string prefix, string suffix)
Parameters
Type |
Name |
Description |
System.String |
prefix |
|
System.String |
suffix |
|
Returns
Type |
Description |
System.IO.FileInfo |
|
|
Improve this Doc
View Source
CultureForName(String)
return a System.Globalization.CultureInfo object equivalent to its programmatic name.
Declaration
public static CultureInfo CultureForName(string localeName)
Parameters
Type |
Name |
Description |
System.String |
localeName |
|
Returns
Type |
Description |
System.Globalization.CultureInfo |
|
|
Improve this Doc
View Source
DumpArray(String, Object[], TextWriter)
Declaration
public static void DumpArray(string label, object[] objs, TextWriter stream)
Parameters
Type |
Name |
Description |
System.String |
label |
|
System.Object[] |
objs |
|
System.IO.TextWriter |
stream |
|
See Also
|
Improve this Doc
View Source
DumpEnumerator(String, IEnumerator, TextWriter)
Convenience method for logging an enumerator.
Declaration
public static void DumpEnumerator(string label, IEnumerator iter, TextWriter stream)
Parameters
Type |
Name |
Description |
System.String |
label |
String logged before/after the items in the enumerator.
|
System.Collections.IEnumerator |
iter |
Each element is ToString()ed and logged on it's own line. If iter is null this is logged differnetly then an empty enumerator.
|
System.IO.TextWriter |
stream |
Stream to log messages to.
|
|
Improve this Doc
View Source
GetDataFile(String)
Gets a resource from the classpath as System.IO.Stream. This method should only
be used, if a real file is needed. To get a stream, code should prefer
J2N.AssemblyExtensions.FindAndGetManifestResourceStream(System.Reflection.Assembly,System.Type,System.String) using
this.GetType().Assembly
and this.GetType()
.
Declaration
protected virtual Stream GetDataFile(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
Type |
Description |
System.IO.Stream |
|
|
Improve this Doc
View Source
GetFullMethodName(String)
Declaration
protected string GetFullMethodName(string memberName = "")
Parameters
Type |
Name |
Description |
System.String |
memberName |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
GetOnlySegmentReader(DirectoryReader)
Some tests expect the directory to contain a single segment, and want to
do tests on that segment's reader. This is an utility method to help them.
Declaration
public static SegmentReader GetOnlySegmentReader(DirectoryReader reader)
Parameters
Returns
|
Improve this Doc
View Source
GetTestClass()
Return the current type being tested.
Declaration
public static Type GetTestClass()
Returns
Type |
Description |
System.Type |
|
|
Improve this Doc
View Source
MaybeWrapReader(IndexReader)
Sometimes wrap the IndexReader as slow, parallel or filter reader (or
combinations of that)
Declaration
public static IndexReader MaybeWrapReader(IndexReader r)
Parameters
Returns
|
Improve this Doc
View Source
NewAlcoholicMergePolicy()
Declaration
public static AlcoholicMergePolicy NewAlcoholicMergePolicy()
Returns
|
Improve this Doc
View Source
NewAlcoholicMergePolicy(Random, TimeZoneInfo)
Declaration
public static AlcoholicMergePolicy NewAlcoholicMergePolicy(Random random, TimeZoneInfo timeZone)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
System.TimeZoneInfo |
timeZone |
|
Returns
|
Improve this Doc
View Source
NewDirectory()
Returns a new Directory instance. Use this when the test does not
care about the specific Directory implementation (most tests).
The Directory is wrapped with BaseDirectoryWrapper.
This means usually it will be picky, such as ensuring that you
properly dispose it and close all open files in your test. It will emulate
some features of Windows, such as not allowing open files to be
overwritten.
Declaration
public static BaseDirectoryWrapper NewDirectory()
Returns
|
Improve this Doc
View Source
NewDirectory(Directory)
Returns a new Directory instance, with contents copied from the
provided directory. See NewDirectory() for more
information.
Declaration
public static BaseDirectoryWrapper NewDirectory(Directory d)
Parameters
Returns
|
Improve this Doc
View Source
NewDirectory(Random)
Declaration
public static BaseDirectoryWrapper NewDirectory(Random random)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
Returns
|
Improve this Doc
View Source
NewDirectory(Random, Directory)
Returns a new Directory instance, using the specified random
with contents copied from the provided directory
. See
NewDirectory() for more information.
Declaration
public static BaseDirectoryWrapper NewDirectory(Random random, Directory directory)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
Directory |
directory |
|
Returns
|
Improve this Doc
View Source
NewField(Random, String, String, FieldType)
Declaration
public static Field NewField(Random random, string name, string value, FieldType type)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
System.String |
name |
|
System.String |
value |
|
FieldType |
type |
|
Returns
|
Improve this Doc
View Source
NewField(String, String, FieldType)
Declaration
public static Field NewField(string name, string value, FieldType type)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.String |
value |
|
FieldType |
type |
|
Returns
|
Improve this Doc
View Source
NewFSDirectory(DirectoryInfo)
Returns a new FSDirectory instance over the given file, which must be a folder.
Declaration
public static BaseDirectoryWrapper NewFSDirectory(DirectoryInfo d)
Parameters
Type |
Name |
Description |
System.IO.DirectoryInfo |
d |
|
Returns
|
Improve this Doc
View Source
NewFSDirectory(DirectoryInfo, LockFactory)
Returns a new FSDirectory instance over the given file, which must be a folder.
Declaration
public static BaseDirectoryWrapper NewFSDirectory(DirectoryInfo d, LockFactory lf)
Parameters
Type |
Name |
Description |
System.IO.DirectoryInfo |
d |
|
LockFactory |
lf |
|
Returns
|
Improve this Doc
View Source
NewIndexWriterConfig(LuceneVersion, Analyzer)
Declaration
public static IndexWriterConfig NewIndexWriterConfig(LuceneVersion v, Analyzer a)
Parameters
Returns
|
Improve this Doc
View Source
NewIndexWriterConfig(Random, LuceneVersion, Analyzer)
Declaration
public static IndexWriterConfig NewIndexWriterConfig(Random random, LuceneVersion v, Analyzer a)
Parameters
Returns
|
Improve this Doc
View Source
NewIOContext(Random)
Declaration
public static IOContext NewIOContext(Random random)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
Returns
|
Improve this Doc
View Source
NewIOContext(Random, IOContext)
Declaration
public static IOContext NewIOContext(Random random, IOContext oldContext)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
IOContext |
oldContext |
|
Returns
|
Improve this Doc
View Source
NewLogMergePolicy()
Declaration
public static LogMergePolicy NewLogMergePolicy()
Returns
|
Improve this Doc
View Source
NewLogMergePolicy(Boolean)
Declaration
public static MergePolicy NewLogMergePolicy(bool useCFS)
Parameters
Type |
Name |
Description |
System.Boolean |
useCFS |
|
Returns
|
Improve this Doc
View Source
NewLogMergePolicy(Boolean, Int32)
Declaration
public static MergePolicy NewLogMergePolicy(bool useCFS, int mergeFactor)
Parameters
Type |
Name |
Description |
System.Boolean |
useCFS |
|
System.Int32 |
mergeFactor |
|
Returns
|
Improve this Doc
View Source
NewLogMergePolicy(Int32)
Declaration
public static MergePolicy NewLogMergePolicy(int mergeFactor)
Parameters
Type |
Name |
Description |
System.Int32 |
mergeFactor |
|
Returns
|
Improve this Doc
View Source
NewLogMergePolicy(Random)
Declaration
public static LogMergePolicy NewLogMergePolicy(Random random)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
Returns
|
Improve this Doc
View Source
NewMergePolicy()
Declaration
public static MergePolicy NewMergePolicy()
Returns
|
Improve this Doc
View Source
NewMergePolicy(Random)
Declaration
public static MergePolicy NewMergePolicy(Random r)
Parameters
Type |
Name |
Description |
System.Random |
r |
|
Returns
|
Improve this Doc
View Source
NewMockDirectory()
Declaration
public static MockDirectoryWrapper NewMockDirectory()
Returns
|
Improve this Doc
View Source
NewMockDirectory(Random)
Declaration
public static MockDirectoryWrapper NewMockDirectory(Random random)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
Returns
|
Improve this Doc
View Source
NewMockFSDirectory(DirectoryInfo)
Declaration
public static MockDirectoryWrapper NewMockFSDirectory(DirectoryInfo d)
Parameters
Type |
Name |
Description |
System.IO.DirectoryInfo |
d |
|
Returns
|
Improve this Doc
View Source
NewSearcher(IndexReader)
Create a new searcher over the reader. this searcher might randomly use
threads.
Declaration
public static IndexSearcher NewSearcher(IndexReader r)
Parameters
Returns
|
Improve this Doc
View Source
NewSearcher(IndexReader, Boolean)
Create a new searcher over the reader. This searcher might randomly use
threads.
Declaration
public static IndexSearcher NewSearcher(IndexReader r, bool maybeWrap)
Parameters
Type |
Name |
Description |
IndexReader |
r |
|
System.Boolean |
maybeWrap |
|
Returns
|
Improve this Doc
View Source
NewSearcher(IndexReader, Boolean, Boolean)
Create a new searcher over the reader. This searcher might randomly use
threads. If maybeWrap
is true, this searcher might wrap the
reader with one that returns null for GetSequentialSubReaders(). If
wrapWithAssertions
is true, this searcher might be an
AssertingIndexSearcher instance.
Declaration
public static IndexSearcher NewSearcher(IndexReader r, bool maybeWrap, bool wrapWithAssertions)
Parameters
Type |
Name |
Description |
IndexReader |
r |
|
System.Boolean |
maybeWrap |
|
System.Boolean |
wrapWithAssertions |
|
Returns
|
Improve this Doc
View Source
NewStringField(Random, String, String, Field.Store)
Declaration
public static Field NewStringField(Random random, string name, string value, Field.Store stored)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
System.String |
name |
|
System.String |
value |
|
Field.Store |
stored |
|
Returns
|
Improve this Doc
View Source
NewStringField(String, String, Field.Store)
Declaration
public static Field NewStringField(string name, string value, Field.Store stored)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.String |
value |
|
Field.Store |
stored |
|
Returns
|
Improve this Doc
View Source
NewTextField(Random, String, String, Field.Store)
Declaration
public static Field NewTextField(Random random, string name, string value, Field.Store stored)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
System.String |
name |
|
System.String |
value |
|
Field.Store |
stored |
|
Returns
|
Improve this Doc
View Source
NewTextField(String, String, Field.Store)
Declaration
public static Field NewTextField(string name, string value, Field.Store stored)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.String |
value |
|
Field.Store |
stored |
|
Returns
|
Improve this Doc
View Source
NewTieredMergePolicy()
Declaration
public static TieredMergePolicy NewTieredMergePolicy()
Returns
|
Improve this Doc
View Source
NewTieredMergePolicy(Random)
Declaration
public static TieredMergePolicy NewTieredMergePolicy(Random random)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
Returns
|
Improve this Doc
View Source
RandomCulture(Random)
Declaration
public static CultureInfo RandomCulture(Random random)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
Returns
Type |
Description |
System.Globalization.CultureInfo |
|
|
Improve this Doc
View Source
RandomGaussian()
Returns the next pseudorandom, Gaussian ("normally") distributed
double
value with mean 0.0
and standard
deviation 1.0
from this random number generator's sequence.
The general contract of nextGaussian
is that one
System.Double value, chosen from (approximately) the usual
normal distribution with mean 0.0
and standard deviation
1.0
, is pseudorandomly generated and returned.
This uses the polar method of G. E. P. Box, M. E. Muller, and
G. Marsaglia, as described by Donald E. Knuth in The Art of
Computer Programming, Volume 3: Seminumerical Algorithms,
section 3.4.1, subsection C, algorithm P. Note that it generates two
independent values at the cost of only one call to StrictMath.log
and one call to StrictMath.sqrt
.
Declaration
public double RandomGaussian()
Returns
Type |
Description |
System.Double |
The next pseudorandom, Gaussian ("normally") distributed
System.Double value with mean 0.0 and
standard deviation 1.0 from this random number
generator's sequence.
|
|
Improve this Doc
View Source
RandomTimeZone(Random)
Declaration
public static TimeZoneInfo RandomTimeZone(Random random)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
Returns
Type |
Description |
System.TimeZoneInfo |
|
|
Improve this Doc
View Source
Rarely()
Declaration
public static bool Rarely()
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Rarely(Random)
Returns true if something should happen rarely,
The actual number returned will be influenced by whether Lucene.Net.Util.LuceneTestCase.TEST_NIGHTLY
is active and RANDOM_MULTIPLIER.
Declaration
public static bool Rarely(Random random)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
SetUp()
For subclasses to override. Overrides must call base.SetUp()
.
Declaration
[SetUp]
public virtual void SetUp()
|
Improve this Doc
View Source
SlowFileExists(Directory, String)
Returns true if the file exists (can be opened), false
if it cannot be opened, and (unlike .NET's
System.IO.File.Exists(System.String)) if there's some
unexpected error.
Declaration
public static bool SlowFileExists(Directory dir, string fileName)
Parameters
Type |
Name |
Description |
Directory |
dir |
|
System.String |
fileName |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TearDown()
For subclasses to override. Overrides must call base.TearDown()
.
Declaration
[TearDown]
public virtual void TearDown()
|
Improve this Doc
View Source
Usually()
Declaration
public static bool Usually()
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Usually(Random)
Declaration
public static bool Usually(Random random)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
Returns
Type |
Description |
System.Boolean |
|