C# Класс Lucene.Net.Util.LuceneTestCase

Наследование: Assert
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
DEFAULT_LINE_DOCS_FILE string
INFOSTREAM bool
JENKINS_LARGE_LINE_DOCS_FILE string
LEAVE_TEMPORARY bool
RANDOM_MULTIPLIER int
SuiteFailureMarker bool
TEMP_DIR System.IO.FileInfo
TEST_AWAITSFIX bool
TEST_CODEC string
TEST_DIRECTORY string
TEST_DOCVALUESFORMAT string
TEST_LINE_DOCS_FILE string
TEST_NIGHTLY bool
TEST_POSTINGSFORMAT string
TEST_SLOW bool
TEST_THROTTLING MockDirectoryWrapper.Throttling_e
TEST_VERSION_CURRENT LuceneVersion
TEST_WEEKLY bool
VERBOSE bool

Защищенные свойства (Protected)

Свойство Тип Описание
DoesntSupportOffsets HashSet

Private Properties

Свойство Тип Описание
AssertTermsSeekingEquals void
CleanupTemporaryFiles void
ConfigureRandom void
GetDVFields ISet
GetFullMethodName string
NewDirectoryImpl Directory
NewFSDirectory BaseDirectoryWrapper
NewFSDirectoryImpl Directory
RegisterToRemoveAfterSuite void
SetUp void
TearDown void
WrapDirectory BaseDirectoryWrapper

Открытые методы

Метод Описание
AsSet ( ) : ISet

Return args as a Set instance. The order of elements is not preserved in iterators.

AssertDeletedDocsEquals ( string info, IndexReader leftReader, IndexReader rightReader ) : void
AssertDocValuesEquals ( string info, IndexReader leftReader, IndexReader rightReader ) : void

checks that docvalues across all fields are equivalent

AssertDocValuesEquals ( string info, int num, Lucene.Net.Index.NumericDocValues leftDocValues, Lucene.Net.Index.NumericDocValues rightDocValues ) : void
AssertDocsAndPositionsEnumEquals ( string info, Lucene.Net.Index.DocsAndPositionsEnum leftDocs, Lucene.Net.Index.DocsAndPositionsEnum rightDocs ) : void

checks docs + freqs + positions + payloads, sequentially

AssertDocsEnumEquals ( string info, Lucene.Net.Index.DocsEnum leftDocs, Lucene.Net.Index.DocsEnum rightDocs, bool hasFreqs ) : void

checks docs + freqs, sequentially

AssertDocsSkippingEquals ( string info, IndexReader leftReader, int docFreq, Lucene.Net.Index.DocsEnum leftDocs, Lucene.Net.Index.DocsEnum rightDocs, bool hasFreqs ) : void

checks advancing docs

AssertFieldInfosEquals ( string info, IndexReader leftReader, IndexReader rightReader ) : void
AssertFieldStatisticsEquals ( string info, Fields leftFields, Fields rightFields ) : void

checks that top-level statistics on Fields are the same

AssertFieldsEquals ( string info, IndexReader leftReader, Fields leftFields, Fields rightFields, bool deep ) : void

Fields api equivalency

AssertNormsEquals ( string info, IndexReader leftReader, IndexReader rightReader ) : void

checks that norms are the same across all fields

AssertPositionsSkippingEquals ( string info, IndexReader leftReader, int docFreq, Lucene.Net.Index.DocsAndPositionsEnum leftDocs, Lucene.Net.Index.DocsAndPositionsEnum rightDocs ) : void

checks advancing docs + positions

AssertReaderEquals ( string info, IndexReader leftReader, IndexReader rightReader ) : void
AssertReaderStatisticsEquals ( string info, IndexReader leftReader, IndexReader rightReader ) : void

checks that reader-level statistics are the same

AssertStoredFieldEquals ( string info, IndexableField leftField, IndexableField rightField ) : void

checks that two stored fields are equivalent

AssertStoredFieldsEquals ( string info, IndexReader leftReader, IndexReader rightReader ) : void

checks that stored fields of all documents are the same

AssertTermStatsEquals ( string info, Lucene.Net.Index.TermsEnum leftTermsEnum, Lucene.Net.Index.TermsEnum rightTermsEnum ) : void

checks term-level statistics

AssertTermVectorsEquals ( string info, IndexReader leftReader, IndexReader rightReader ) : void

checks that term vectors across all fields are equivalent

AssertTermsEnumEquals ( string info, IndexReader leftReader, Lucene.Net.Index.TermsEnum leftTermsEnum, Lucene.Net.Index.TermsEnum rightTermsEnum, bool deep ) : void

checks the terms enum sequentially if deep is false, it does a 'shallow' test that doesnt go down to the docsenums

AssertTermsEquals ( string info, IndexReader leftReader, Lucene.Net.Index.Terms leftTerms, Lucene.Net.Index.Terms rightTerms, bool deep ) : void

Terms api equivalency

AssertTermsStatisticsEquals ( string info, Lucene.Net.Index.Terms leftTerms, Lucene.Net.Index.Terms rightTerms ) : void

checks collection-level statistics on Terms

AssumeFalse ( string msg, bool condition ) : void
AssumeNoException ( string msg, Exception e ) : void
AssumeTrue ( string msg, bool condition ) : void
AtLeast ( Random random, int i ) : int

Returns a number of at least i

The actual number returned will be influenced by whether #TEST_NIGHTLY is active and #RANDOM_MULTIPLIER, but also with some random fudge.

AtLeast ( int i ) : int
CreateTempDir ( ) : DirectoryInfo

Creates an empty, temporary folder (when the name of the folder is of no importance).

CreateTempDir ( string prefix ) : DirectoryInfo

Creates an empty, temporary folder with the given name prefix under the test class's #getBaseTempDirForTestClass().

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.

CreateTempFile ( ) : FileInfo

Creates an empty temporary file.

CreateTempFile ( string prefix, string suffix ) : FileInfo

Creates an empty file with the given prefix and suffix under the test class's #getBaseTempDirForTestClass().

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.

DefaultCodecSupportsDocValues ( ) : bool

Return a random Locale from the available locales on the system.

Return a random TimeZone from the available timezones on the system

return a Locale object equivalent to its programmatic name

DefaultCodecSupportsDocsWithField ( ) : bool

Returns true if the codec "supports" docsWithField (other codecs return MatchAllBits, because you couldnt write missing values before)

DefaultCodecSupportsFieldUpdates ( ) : bool

Returns true if the codec "supports" field updates.

DefaultCodecSupportsMissingDocValues ( ) : bool

Returns true if the default codec supports single valued docvalues with missing values

DefaultCodecSupportsSortedSet ( ) : bool

Returns true if the default codec supports SORTED_SET docvalues

DumpArray ( string label, Object objs, TextWriter stream ) : void

Convenience method for logging an array. Wraps the array in an iterator and delegates

DumpIterator ( string label, System iter, TextWriter stream ) : void

Convenience method for logging an iterator.

GetOnlySegmentReader ( DirectoryReader reader ) : Lucene.Net.Index.SegmentReader

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.

LuceneTestCase ( ) : System.Collections.Concurrent
MaybeWrapReader ( IndexReader r ) : IndexReader

Sometimes wrap the IndexReader as slow, parallel or filter reader (or combinations of that)

NewAlcoholicMergePolicy ( ) : Lucene.Net.Index.AlcoholicMergePolicy
NewAlcoholicMergePolicy ( Random r, TimeZone tz ) : AlcoholicMergePolicy
NewDirectory ( ) : BaseDirectoryWrapper

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

NewDirectory ( Directory d ) : BaseDirectoryWrapper

Returns a new Directory instance, with contents copied from the provided directory. See #newDirectory() for more information.

NewDirectory ( Random r ) : BaseDirectoryWrapper

Returns a new Directory instance, using the specified random. See #newDirectory() for more information.

NewDirectory ( Random r, Directory d ) : BaseDirectoryWrapper

Returns a new Directory instance, using the specified random with contents copied from the provided directory. See #newDirectory() for more information.

NewFSDirectory ( DirectoryInfo d ) : BaseDirectoryWrapper

Returns a new FSDirectory instance over the given file, which must be a folder.

NewFSDirectory ( DirectoryInfo d, LockFactory lf ) : BaseDirectoryWrapper

Returns a new FSDirectory instance over the given file, which must be a folder.

NewField ( Random random, string name, string value, FieldType type ) : Field

LUCENENET specific Is non-static because OLD_FORMAT_IMPERSONATION_IS_ACTIVE is now non-static.

NewField ( string name, string value, FieldType type ) : Field

LUCENENET specific Is non-static because OLD_FORMAT_IMPERSONATION_IS_ACTIVE is now non-static.

NewIOContext ( Random random ) : IOContext

TODO: javadoc

NewIOContext ( Random random, IOContext oldContext ) : IOContext

TODO: javadoc

NewIndexWriterConfig ( LuceneVersion v, Analyzer a ) : IndexWriterConfig

create a new index writer config with random defaults LUCENENET specific Non-static so that we do not depend on any hidden static dependencies

NewIndexWriterConfig ( Random r, LuceneVersion v, Analyzer a ) : IndexWriterConfig

LUCENENET specific Non-static so that we do not depend on any hidden static dependencies

NewIndexWriterConfig ( Random r, LuceneVersion v, Analyzer a, Similarity similarity, TimeZone timezone ) : IndexWriterConfig

create a new index writer config with random defaults using the specified random LUCENENET specific This is the only static ctor for IndexWriterConfig because it removes the dependency on ClassEnvRule by using parameters Similarity and TimeZone.

NewLogMergePolicy ( ) : LogMergePolicy
NewLogMergePolicy ( Random r ) : LogMergePolicy
NewLogMergePolicy ( bool useCFS ) : MergePolicy
NewLogMergePolicy ( bool useCFS, int mergeFactor ) : MergePolicy
NewLogMergePolicy ( int mergeFactor ) : MergePolicy
NewMergePolicy ( Random r, TimeZone timezone ) : MergePolicy
NewMergePolicy ( TimeZone timezone ) : MergePolicy
NewMockDirectory ( ) : MockDirectoryWrapper
NewMockDirectory ( Random r ) : MockDirectoryWrapper
NewMockFSDirectory ( DirectoryInfo d ) : MockDirectoryWrapper
NewSearcher ( IndexReader r ) : IndexSearcher

Create a new searcher over the reader. this searcher might randomly use threads. LUCENENET specific Is non-static because ClassEnvRule is now non-static.

NewSearcher ( IndexReader r, Similarity similarity ) : IndexSearcher
NewSearcher ( IndexReader r, bool maybeWrap ) : IndexSearcher

Create a new searcher over the reader. This searcher might randomly use threads.

NewSearcher ( IndexReader r, bool maybeWrap, Similarity similarity ) : IndexSearcher

Create a new searcher over the reader. this searcher might randomly use threads.

NewSearcher ( IndexReader r, bool maybeWrap, bool wrapWithAssertions ) : IndexSearcher
NewSearcher ( IndexReader r, bool maybeWrap, bool wrapWithAssertions, Similarity similarity ) : IndexSearcher

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.

NewStringField ( Random random, string name, string value, Field stored ) : Field

LUCENENET specific Is non-static because OLD_FORMAT_IMPERSONATION_IS_ACTIVE is now non-static.

NewStringField ( string name, string value, Field stored ) : Field

LUCENENET specific Is non-static because OLD_FORMAT_IMPERSONATION_IS_ACTIVE is now non-static.

NewTextField ( Random random, string name, string value, Field stored ) : Field

LUCENENET specific Is non-static because OLD_FORMAT_IMPERSONATION_IS_ACTIVE is also non-static to reduce hidden dependencies on this variable.

NewTextField ( string name, string value, Field stored ) : Field

LUCENENET specific Is non-static because OLD_FORMAT_IMPERSONATION_IS_ACTIVE is now non-static.

NewTieredMergePolicy ( ) : TieredMergePolicy
NewTieredMergePolicy ( Random r ) : TieredMergePolicy
Random ( ) : Random

Access to the current RandomizedContext's 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 Random instance will be different when this method is called inside a BeforeClass hook (static suite scope) and within Before/ After hooks or test methods.

The returned instance must not be shared with other threads or cross a single scope's boundary. For example, a Random acquired within a test method shouldn't be reused for another test case.

There is an overhead connected with getting the Random for a particular context and thread. It is better to cache the Random locally if tight loops with multiple invocations are present or create a derivative local Random for millions of calls like this:

 Random random = new Random(random().nextLong()); // tight loop with many invocations. 

Rarely ( ) : bool
Rarely ( Random random ) : bool

Returns true if something should happen rarely,

The actual number returned will be influenced by whether #TEST_NIGHTLY is active and #RANDOM_MULTIPLIER.

SlowFileExists ( Directory dir, string fileName ) : bool

Returns true if the file exists (can be opened), false if it cannot be opened, and (unlike Java's File.exists) if there's some unexpected error.

TestThread ( ) : bool

Returns true if and only if the calling thread is the primary thread executing the test case.

Usually ( ) : bool
Usually ( Random random ) : bool

Защищенные методы

Метод Описание
AssertSaneFieldCaches ( string msg ) : void

Asserts that FieldCacheSanityChecker does not detect any problems with FieldCache.DEFAULT.

If any problems are found, they are logged to System.err (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.

GetDataFile ( string name ) : Stream

Gets a resource from the classpath as File. this method should only be used, if a real file is needed. To get a stream, code should prefer Class#getResourceAsStream using {@code this.getClass()}.

randon ( ) : Random

Приватные методы

Метод Описание
AssertTermsSeekingEquals ( string info, Lucene.Net.Index.Terms leftTerms, Lucene.Net.Index.Terms rightTerms ) : void
CleanupTemporaryFiles ( ) : void
ConfigureRandom ( Random r, MergePolicy mergePolicy ) : void
GetDVFields ( IndexReader reader ) : ISet
GetFullMethodName ( ) : string
NewDirectoryImpl ( Random random, string clazzName ) : Directory
NewFSDirectory ( DirectoryInfo d, LockFactory lf, bool bare ) : BaseDirectoryWrapper
NewFSDirectoryImpl ( Type clazz, DirectoryInfo file ) : Directory
RegisterToRemoveAfterSuite ( FileSystemInfo f ) : void

Register temporary folder for removal after the suite completes.

SetUp ( ) : void
TearDown ( ) : void
WrapDirectory ( Random random, Directory directory, bool bare ) : BaseDirectoryWrapper

Описание методов

AsSet() публичный статический Метод

Return args as a Set instance. The order of elements is not preserved in iterators.
public static AsSet ( ) : ISet
Результат ISet

AssertDeletedDocsEquals() публичный Метод

public AssertDeletedDocsEquals ( string info, IndexReader leftReader, IndexReader rightReader ) : void
info string
leftReader Lucene.Net.Index.IndexReader
rightReader Lucene.Net.Index.IndexReader
Результат void

AssertDocValuesEquals() публичный Метод

checks that docvalues across all fields are equivalent
public AssertDocValuesEquals ( string info, IndexReader leftReader, IndexReader rightReader ) : void
info string
leftReader Lucene.Net.Index.IndexReader
rightReader Lucene.Net.Index.IndexReader
Результат void

AssertDocValuesEquals() публичный Метод

public AssertDocValuesEquals ( string info, int num, Lucene.Net.Index.NumericDocValues leftDocValues, Lucene.Net.Index.NumericDocValues rightDocValues ) : void
info string
num int
leftDocValues Lucene.Net.Index.NumericDocValues
rightDocValues Lucene.Net.Index.NumericDocValues
Результат void

AssertDocsAndPositionsEnumEquals() публичный Метод

checks docs + freqs + positions + payloads, sequentially
public AssertDocsAndPositionsEnumEquals ( string info, Lucene.Net.Index.DocsAndPositionsEnum leftDocs, Lucene.Net.Index.DocsAndPositionsEnum rightDocs ) : void
info string
leftDocs Lucene.Net.Index.DocsAndPositionsEnum
rightDocs Lucene.Net.Index.DocsAndPositionsEnum
Результат void

AssertDocsEnumEquals() публичный Метод

checks docs + freqs, sequentially
public AssertDocsEnumEquals ( string info, Lucene.Net.Index.DocsEnum leftDocs, Lucene.Net.Index.DocsEnum rightDocs, bool hasFreqs ) : void
info string
leftDocs Lucene.Net.Index.DocsEnum
rightDocs Lucene.Net.Index.DocsEnum
hasFreqs bool
Результат void

AssertDocsSkippingEquals() публичный Метод

checks advancing docs
public AssertDocsSkippingEquals ( string info, IndexReader leftReader, int docFreq, Lucene.Net.Index.DocsEnum leftDocs, Lucene.Net.Index.DocsEnum rightDocs, bool hasFreqs ) : void
info string
leftReader Lucene.Net.Index.IndexReader
docFreq int
leftDocs Lucene.Net.Index.DocsEnum
rightDocs Lucene.Net.Index.DocsEnum
hasFreqs bool
Результат void

AssertFieldInfosEquals() публичный Метод

public AssertFieldInfosEquals ( string info, IndexReader leftReader, IndexReader rightReader ) : void
info string
leftReader Lucene.Net.Index.IndexReader
rightReader Lucene.Net.Index.IndexReader
Результат void

AssertFieldStatisticsEquals() публичный Метод

checks that top-level statistics on Fields are the same
public AssertFieldStatisticsEquals ( string info, Fields leftFields, Fields rightFields ) : void
info string
leftFields Fields
rightFields Fields
Результат void

AssertFieldsEquals() публичный Метод

Fields api equivalency
public AssertFieldsEquals ( string info, IndexReader leftReader, Fields leftFields, Fields rightFields, bool deep ) : void
info string
leftReader Lucene.Net.Index.IndexReader
leftFields Fields
rightFields Fields
deep bool
Результат void

AssertNormsEquals() публичный Метод

checks that norms are the same across all fields
public AssertNormsEquals ( string info, IndexReader leftReader, IndexReader rightReader ) : void
info string
leftReader Lucene.Net.Index.IndexReader
rightReader Lucene.Net.Index.IndexReader
Результат void

AssertPositionsSkippingEquals() публичный Метод

checks advancing docs + positions
public AssertPositionsSkippingEquals ( string info, IndexReader leftReader, int docFreq, Lucene.Net.Index.DocsAndPositionsEnum leftDocs, Lucene.Net.Index.DocsAndPositionsEnum rightDocs ) : void
info string
leftReader Lucene.Net.Index.IndexReader
docFreq int
leftDocs Lucene.Net.Index.DocsAndPositionsEnum
rightDocs Lucene.Net.Index.DocsAndPositionsEnum
Результат void

AssertReaderEquals() публичный Метод

public AssertReaderEquals ( string info, IndexReader leftReader, IndexReader rightReader ) : void
info string
leftReader Lucene.Net.Index.IndexReader
rightReader Lucene.Net.Index.IndexReader
Результат void

AssertReaderStatisticsEquals() публичный Метод

checks that reader-level statistics are the same
public AssertReaderStatisticsEquals ( string info, IndexReader leftReader, IndexReader rightReader ) : void
info string
leftReader Lucene.Net.Index.IndexReader
rightReader Lucene.Net.Index.IndexReader
Результат void

AssertSaneFieldCaches() защищенный статический Метод

Asserts that FieldCacheSanityChecker does not detect any problems with FieldCache.DEFAULT.

If any problems are found, they are logged to System.err (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.

protected static AssertSaneFieldCaches ( string msg ) : void
msg string
Результат void

AssertStoredFieldEquals() публичный Метод

checks that two stored fields are equivalent
public AssertStoredFieldEquals ( string info, IndexableField leftField, IndexableField rightField ) : void
info string
leftField IndexableField
rightField IndexableField
Результат void

AssertStoredFieldsEquals() публичный Метод

checks that stored fields of all documents are the same
public AssertStoredFieldsEquals ( string info, IndexReader leftReader, IndexReader rightReader ) : void
info string
leftReader Lucene.Net.Index.IndexReader
rightReader Lucene.Net.Index.IndexReader
Результат void

AssertTermStatsEquals() публичный Метод

checks term-level statistics
public AssertTermStatsEquals ( string info, Lucene.Net.Index.TermsEnum leftTermsEnum, Lucene.Net.Index.TermsEnum rightTermsEnum ) : void
info string
leftTermsEnum Lucene.Net.Index.TermsEnum
rightTermsEnum Lucene.Net.Index.TermsEnum
Результат void

AssertTermVectorsEquals() публичный Метод

checks that term vectors across all fields are equivalent
public AssertTermVectorsEquals ( string info, IndexReader leftReader, IndexReader rightReader ) : void
info string
leftReader Lucene.Net.Index.IndexReader
rightReader Lucene.Net.Index.IndexReader
Результат void

AssertTermsEnumEquals() публичный Метод

checks the terms enum sequentially if deep is false, it does a 'shallow' test that doesnt go down to the docsenums
public AssertTermsEnumEquals ( string info, IndexReader leftReader, Lucene.Net.Index.TermsEnum leftTermsEnum, Lucene.Net.Index.TermsEnum rightTermsEnum, bool deep ) : void
info string
leftReader Lucene.Net.Index.IndexReader
leftTermsEnum Lucene.Net.Index.TermsEnum
rightTermsEnum Lucene.Net.Index.TermsEnum
deep bool
Результат void

AssertTermsEquals() публичный Метод

Terms api equivalency
public AssertTermsEquals ( string info, IndexReader leftReader, Lucene.Net.Index.Terms leftTerms, Lucene.Net.Index.Terms rightTerms, bool deep ) : void
info string
leftReader Lucene.Net.Index.IndexReader
leftTerms Lucene.Net.Index.Terms
rightTerms Lucene.Net.Index.Terms
deep bool
Результат void

AssertTermsStatisticsEquals() публичный Метод

checks collection-level statistics on Terms
public AssertTermsStatisticsEquals ( string info, Lucene.Net.Index.Terms leftTerms, Lucene.Net.Index.Terms rightTerms ) : void
info string
leftTerms Lucene.Net.Index.Terms
rightTerms Lucene.Net.Index.Terms
Результат void

AssumeFalse() публичный статический Метод

public static AssumeFalse ( string msg, bool condition ) : void
msg string
condition bool
Результат void

AssumeNoException() публичный статический Метод

public static AssumeNoException ( string msg, Exception e ) : void
msg string
e System.Exception
Результат void

AssumeTrue() публичный статический Метод

public static AssumeTrue ( string msg, bool condition ) : void
msg string
condition bool
Результат void

AtLeast() публичный статический Метод

Returns a number of at least i

The actual number returned will be influenced by whether #TEST_NIGHTLY is active and #RANDOM_MULTIPLIER, but also with some random fudge.

public static AtLeast ( Random random, int i ) : int
random System.Random
i int
Результат int

AtLeast() публичный статический Метод

public static AtLeast ( int i ) : int
i int
Результат int

CreateTempDir() публичный статический Метод

Creates an empty, temporary folder (when the name of the folder is of no importance).
public static CreateTempDir ( ) : DirectoryInfo
Результат System.IO.DirectoryInfo

CreateTempDir() публичный статический Метод

Creates an empty, temporary folder with the given name prefix under the test class's #getBaseTempDirForTestClass().

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.

public static CreateTempDir ( string prefix ) : DirectoryInfo
prefix string
Результат System.IO.DirectoryInfo

CreateTempFile() публичный статический Метод

Creates an empty temporary file.
public static CreateTempFile ( ) : FileInfo
Результат System.IO.FileInfo

CreateTempFile() публичный статический Метод

Creates an empty file with the given prefix and suffix under the test class's #getBaseTempDirForTestClass().

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.

public static CreateTempFile ( string prefix, string suffix ) : FileInfo
prefix string
suffix string
Результат System.IO.FileInfo

DefaultCodecSupportsDocValues() публичный статический Метод

Return a random Locale from the available locales on the system. Return a random TimeZone from the available timezones on the system return a Locale object equivalent to its programmatic name
public static DefaultCodecSupportsDocValues ( ) : bool
Результат bool

DefaultCodecSupportsDocsWithField() публичный статический Метод

Returns true if the codec "supports" docsWithField (other codecs return MatchAllBits, because you couldnt write missing values before)
public static DefaultCodecSupportsDocsWithField ( ) : bool
Результат bool

DefaultCodecSupportsFieldUpdates() публичный статический Метод

Returns true if the codec "supports" field updates.
public static DefaultCodecSupportsFieldUpdates ( ) : bool
Результат bool

DefaultCodecSupportsMissingDocValues() публичный статический Метод

Returns true if the default codec supports single valued docvalues with missing values
public static DefaultCodecSupportsMissingDocValues ( ) : bool
Результат bool

DefaultCodecSupportsSortedSet() публичный статический Метод

Returns true if the default codec supports SORTED_SET docvalues
public static DefaultCodecSupportsSortedSet ( ) : bool
Результат bool

DumpArray() публичный статический Метод

Convenience method for logging an array. Wraps the array in an iterator and delegates
public static DumpArray ( string label, Object objs, TextWriter stream ) : void
label string
objs Object
stream System.IO.TextWriter
Результат void

DumpIterator() публичный статический Метод

Convenience method for logging an iterator.
public static DumpIterator ( string label, System iter, TextWriter stream ) : void
label string String logged before/after the items in the iterator
iter System Each next() is toString()ed and logged on it's own line. If iter is null this is logged differnetly then an empty iterator.
stream System.IO.TextWriter Stream to log messages to.
Результат void

GetDataFile() защищенный Метод

Gets a resource from the classpath as File. this method should only be used, if a real file is needed. To get a stream, code should prefer Class#getResourceAsStream using {@code this.getClass()}.
protected GetDataFile ( string name ) : Stream
name string
Результат Stream

GetOnlySegmentReader() публичный статический Метод

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.
public static GetOnlySegmentReader ( DirectoryReader reader ) : Lucene.Net.Index.SegmentReader
reader Lucene.Net.Index.DirectoryReader
Результат Lucene.Net.Index.SegmentReader

LuceneTestCase() публичный Метод

public LuceneTestCase ( ) : System.Collections.Concurrent
Результат System.Collections.Concurrent

MaybeWrapReader() публичный статический Метод

Sometimes wrap the IndexReader as slow, parallel or filter reader (or combinations of that)
public static MaybeWrapReader ( IndexReader r ) : IndexReader
r Lucene.Net.Index.IndexReader
Результат Lucene.Net.Index.IndexReader

NewAlcoholicMergePolicy() публичный Метод

public NewAlcoholicMergePolicy ( ) : Lucene.Net.Index.AlcoholicMergePolicy
Результат Lucene.Net.Index.AlcoholicMergePolicy

NewAlcoholicMergePolicy() публичный статический Метод

public static NewAlcoholicMergePolicy ( Random r, TimeZone tz ) : AlcoholicMergePolicy
r Random
tz TimeZone
Результат AlcoholicMergePolicy

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 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 NewDirectory ( ) : BaseDirectoryWrapper
Результат BaseDirectoryWrapper

NewDirectory() публичный статический Метод

Returns a new Directory instance, with contents copied from the provided directory. See #newDirectory() for more information.
public static NewDirectory ( Directory d ) : BaseDirectoryWrapper
d Directory
Результат BaseDirectoryWrapper

NewDirectory() публичный статический Метод

Returns a new Directory instance, using the specified random. See #newDirectory() for more information.
public static NewDirectory ( Random r ) : BaseDirectoryWrapper
r Random
Результат BaseDirectoryWrapper

NewDirectory() публичный статический Метод

Returns a new Directory instance, using the specified random with contents copied from the provided directory. See #newDirectory() for more information.
public static NewDirectory ( Random r, Directory d ) : BaseDirectoryWrapper
r Random
d Directory
Результат BaseDirectoryWrapper

NewFSDirectory() публичный статический Метод

Returns a new FSDirectory instance over the given file, which must be a folder.
public static NewFSDirectory ( DirectoryInfo d ) : BaseDirectoryWrapper
d DirectoryInfo
Результат BaseDirectoryWrapper

NewFSDirectory() публичный статический Метод

Returns a new FSDirectory instance over the given file, which must be a folder.
public static NewFSDirectory ( DirectoryInfo d, LockFactory lf ) : BaseDirectoryWrapper
d DirectoryInfo
lf LockFactory
Результат BaseDirectoryWrapper

NewField() публичный Метод

LUCENENET specific Is non-static because OLD_FORMAT_IMPERSONATION_IS_ACTIVE is now non-static.
public NewField ( Random random, string name, string value, FieldType type ) : Field
random Random
name string
value string
type FieldType
Результат Field

NewField() публичный Метод

LUCENENET specific Is non-static because OLD_FORMAT_IMPERSONATION_IS_ACTIVE is now non-static.
public NewField ( string name, string value, FieldType type ) : Field
name string
value string
type FieldType
Результат Field

NewIOContext() публичный статический Метод

TODO: javadoc
public static NewIOContext ( Random random ) : IOContext
random Random
Результат IOContext

NewIOContext() публичный статический Метод

TODO: javadoc
public static NewIOContext ( Random random, IOContext oldContext ) : IOContext
random Random
oldContext IOContext
Результат IOContext

NewIndexWriterConfig() публичный Метод

create a new index writer config with random defaults LUCENENET specific Non-static so that we do not depend on any hidden static dependencies
public NewIndexWriterConfig ( LuceneVersion v, Analyzer a ) : IndexWriterConfig
v LuceneVersion
a Analyzer
Результат IndexWriterConfig

NewIndexWriterConfig() публичный Метод

LUCENENET specific Non-static so that we do not depend on any hidden static dependencies
public NewIndexWriterConfig ( Random r, LuceneVersion v, Analyzer a ) : IndexWriterConfig
r Random
v LuceneVersion
a Analyzer
Результат IndexWriterConfig

NewIndexWriterConfig() публичный статический Метод

create a new index writer config with random defaults using the specified random LUCENENET specific This is the only static ctor for IndexWriterConfig because it removes the dependency on ClassEnvRule by using parameters Similarity and TimeZone.
public static NewIndexWriterConfig ( Random r, LuceneVersion v, Analyzer a, Similarity similarity, TimeZone timezone ) : IndexWriterConfig
r Random
v LuceneVersion
a Analyzer
similarity Similarity
timezone TimeZone
Результат IndexWriterConfig

NewLogMergePolicy() публичный статический Метод

public static NewLogMergePolicy ( ) : LogMergePolicy
Результат LogMergePolicy

NewLogMergePolicy() публичный статический Метод

public static NewLogMergePolicy ( Random r ) : LogMergePolicy
r Random
Результат LogMergePolicy

NewLogMergePolicy() публичный статический Метод

public static NewLogMergePolicy ( bool useCFS ) : MergePolicy
useCFS bool
Результат MergePolicy

NewLogMergePolicy() публичный статический Метод

public static NewLogMergePolicy ( bool useCFS, int mergeFactor ) : MergePolicy
useCFS bool
mergeFactor int
Результат MergePolicy

NewLogMergePolicy() публичный статический Метод

public static NewLogMergePolicy ( int mergeFactor ) : MergePolicy
mergeFactor int
Результат MergePolicy

NewMergePolicy() публичный статический Метод

public static NewMergePolicy ( Random r, TimeZone timezone ) : MergePolicy
r Random
timezone TimeZone /// LUCENENET specific /// Timezone added to remove dependency on the then-static ///
Результат MergePolicy

NewMergePolicy() публичный статический Метод

public static NewMergePolicy ( TimeZone timezone ) : MergePolicy
timezone TimeZone /// LUCENENET specific /// Timezone added to remove dependency on the then-static ///
Результат MergePolicy

NewMockDirectory() публичный статический Метод

public static NewMockDirectory ( ) : MockDirectoryWrapper
Результат MockDirectoryWrapper

NewMockDirectory() публичный статический Метод

public static NewMockDirectory ( Random r ) : MockDirectoryWrapper
r Random
Результат MockDirectoryWrapper

NewMockFSDirectory() публичный статический Метод

public static NewMockFSDirectory ( DirectoryInfo d ) : MockDirectoryWrapper
d DirectoryInfo
Результат MockDirectoryWrapper

NewSearcher() публичный Метод

Create a new searcher over the reader. this searcher might randomly use threads. LUCENENET specific Is non-static because ClassEnvRule is now non-static.
public NewSearcher ( IndexReader r ) : IndexSearcher
r IndexReader
Результат IndexSearcher

NewSearcher() публичный статический Метод

public static NewSearcher ( IndexReader r, Similarity similarity ) : IndexSearcher
r IndexReader
similarity Similarity /// LUCENENET specific /// Removes dependency on ///
Результат IndexSearcher

NewSearcher() публичный Метод

Create a new searcher over the reader. This searcher might randomly use threads.
public NewSearcher ( IndexReader r, bool maybeWrap ) : IndexSearcher
r IndexReader
maybeWrap bool
Результат IndexSearcher

NewSearcher() публичный статический Метод

Create a new searcher over the reader. this searcher might randomly use threads.
public static NewSearcher ( IndexReader r, bool maybeWrap, Similarity similarity ) : IndexSearcher
r IndexReader
maybeWrap bool
similarity Similarity /// LUCENENET specific /// Removes dependency on ///
Результат IndexSearcher

NewSearcher() публичный Метод

public NewSearcher ( IndexReader r, bool maybeWrap, bool wrapWithAssertions ) : IndexSearcher
r IndexReader
maybeWrap bool
wrapWithAssertions bool
Результат IndexSearcher

NewSearcher() публичный статический Метод

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.
public static NewSearcher ( IndexReader r, bool maybeWrap, bool wrapWithAssertions, Similarity similarity ) : IndexSearcher
r IndexReader
maybeWrap bool
wrapWithAssertions bool
similarity Similarity /// LUCENENET specific /// Removes dependency on ///
Результат IndexSearcher

NewStringField() публичный Метод

LUCENENET specific Is non-static because OLD_FORMAT_IMPERSONATION_IS_ACTIVE is now non-static.
public NewStringField ( Random random, string name, string value, Field stored ) : Field
random Random
name string
value string
stored Field
Результат Field

NewStringField() публичный Метод

LUCENENET specific Is non-static because OLD_FORMAT_IMPERSONATION_IS_ACTIVE is now non-static.
public NewStringField ( string name, string value, Field stored ) : Field
name string
value string
stored Field
Результат Field

NewTextField() публичный Метод

LUCENENET specific Is non-static because OLD_FORMAT_IMPERSONATION_IS_ACTIVE is also non-static to reduce hidden dependencies on this variable.
public NewTextField ( Random random, string name, string value, Field stored ) : Field
random Random
name string
value string
stored Field
Результат Field

NewTextField() публичный Метод

LUCENENET specific Is non-static because OLD_FORMAT_IMPERSONATION_IS_ACTIVE is now non-static.
public NewTextField ( string name, string value, Field stored ) : Field
name string
value string
stored Field
Результат Field

NewTieredMergePolicy() публичный статический Метод

public static NewTieredMergePolicy ( ) : TieredMergePolicy
Результат TieredMergePolicy

NewTieredMergePolicy() публичный статический Метод

public static NewTieredMergePolicy ( Random r ) : TieredMergePolicy
r Random
Результат TieredMergePolicy

Random() публичный статический Метод

Access to the current RandomizedContext's 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 Random instance will be different when this method is called inside a BeforeClass hook (static suite scope) and within Before/ After hooks or test methods.

The returned instance must not be shared with other threads or cross a single scope's boundary. For example, a Random acquired within a test method shouldn't be reused for another test case.

There is an overhead connected with getting the Random for a particular context and thread. It is better to cache the Random locally if tight loops with multiple invocations are present or create a derivative local Random for millions of calls like this:

 Random random = new Random(random().nextLong()); // tight loop with many invocations. 
public static Random ( ) : Random
Результат Random

Rarely() публичный статический Метод

public static Rarely ( ) : bool
Результат bool

Rarely() публичный статический Метод

Returns true if something should happen rarely,

The actual number returned will be influenced by whether #TEST_NIGHTLY is active and #RANDOM_MULTIPLIER.

public static Rarely ( Random random ) : bool
random Random
Результат bool

SlowFileExists() публичный статический Метод

Returns true if the file exists (can be opened), false if it cannot be opened, and (unlike Java's File.exists) if there's some unexpected error.
public static SlowFileExists ( Directory dir, string fileName ) : bool
dir Directory
fileName string
Результат bool

TestThread() публичный статический Метод

Returns true if and only if the calling thread is the primary thread executing the test case.
public static TestThread ( ) : bool
Результат bool

Usually() публичный статический Метод

public static Usually ( ) : bool
Результат bool

Usually() публичный статический Метод

public static Usually ( Random random ) : bool
random Random
Результат bool

randon() защищенный статический Метод

protected static randon ( ) : Random
Результат Random

Описание свойств

DEFAULT_LINE_DOCS_FILE публичное статическое свойство

TODO: javadoc?
public static string DEFAULT_LINE_DOCS_FILE
Результат string

DoesntSupportOffsets защищенное статическое свойство

protected static HashSet DoesntSupportOffsets
Результат HashSet

INFOSTREAM публичное статическое свойство

TODO: javadoc?
public static bool INFOSTREAM
Результат bool

JENKINS_LARGE_LINE_DOCS_FILE публичное статическое свойство

TODO: javadoc?
public static string JENKINS_LARGE_LINE_DOCS_FILE
Результат string

LEAVE_TEMPORARY публичное статическое свойство

Leave temporary files on disk, even on successful runs.
public static bool LEAVE_TEMPORARY
Результат bool

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).
public static int RANDOM_MULTIPLIER
Результат int

SuiteFailureMarker публичное статическое свойство

Suite failure marker (any error in the test or suite scope).
public static bool SuiteFailureMarker
Результат bool

TEMP_DIR публичное статическое свойство

public static FileInfo,System.IO TEMP_DIR
Результат System.IO.FileInfo

TEST_AWAITSFIX публичное статическое свойство

Whether or not AwaitsFix tests should run.
public static bool TEST_AWAITSFIX
Результат bool

TEST_CODEC публичное статическое свойство

Gets the codec to run tests with.
public static string TEST_CODEC
Результат string

TEST_DIRECTORY публичное статическое свойство

Gets the directory to run tests with
public static string TEST_DIRECTORY
Результат string

TEST_DOCVALUESFORMAT публичное статическое свойство

Gets the docValuesFormat to run tests with
public static string TEST_DOCVALUESFORMAT
Результат string

TEST_LINE_DOCS_FILE публичное статическое свойство

the line file used by LineFileDocs
public static string TEST_LINE_DOCS_FILE
Результат string

TEST_NIGHTLY публичное статическое свойство

Whether or not Nightly tests should run.
public static bool TEST_NIGHTLY
Результат bool

TEST_POSTINGSFORMAT публичное статическое свойство

Gets the postingsFormat to run tests with.
public static string TEST_POSTINGSFORMAT
Результат string

TEST_SLOW публичное статическое свойство

Whether or not Slow tests should run.
public static bool TEST_SLOW
Результат bool

TEST_THROTTLING публичное статическое свойство

Throttling, see MockDirectoryWrapper#setThrottling(Throttling).
public static MockDirectoryWrapper.Throttling_e TEST_THROTTLING
Результат MockDirectoryWrapper.Throttling_e

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:

public static LuceneVersion TEST_VERSION_CURRENT
Результат LuceneVersion

TEST_WEEKLY публичное статическое свойство

Whether or not Weekly tests should run.
public static bool TEST_WEEKLY
Результат bool

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.
public static bool VERBOSE
Результат bool