C# 클래스 Lucene.Net.Util.LuceneTestCase

상속: Assert
파일 보기 프로젝트 열기: apache/lucenenet 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
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

보호된 프로퍼티들

프로퍼티 타입 설명
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