Namespace Lucene.Net.Util
Classes
AbstractBeforeAfterRule
LUCENENET specific for mimicking the JUnit rule functionality. We simplify things by just running the rules inside LuceneTestCase.
ApiScanTestBase
LUCENENET specific - functionality for scanning the API to ensure naming and .NET conventions are followed consistently. Not for use by end users.
BaseDocIdSetTestCase<T>
Base test class for Lucene.Net.Search.DocIdSets.
CultureInfoSupport
English
Converts numbers to english strings for testing.
ExceptionSerializationTestBase
FailOnNonBulkMergesInfoStream
Hackidy-Häck-Hack to cause a test to fail on non-bulk merges
LineFileDocs
Minimal port of benchmark's LneDocSource + DocMaker, so tests can enum docs from a line file created by benchmark's WriteLineDoc task
LuceneTestCase
LUCENENET specific extensions to LuceneTestCase to make it easier to port tests from Java with fewer changes.
LuceneTestCase.AwaitsFixAttribute
Attribute for tests which exhibit a known issue and are temporarily disabled.
LuceneTestCase.NightlyAttribute
Attribute for tests that should only be run during nightly builds.
LuceneTestCase.SlowAttribute
Attribute for tests that are slow. Slow tests do run by default but can be disabled if a quick run is needed.
LuceneTestCase.SuppressCodecsAttribute
Attribute for test classes that should avoid certain codec types (because they are expensive, for example).
LuceneTestCase.SuppressTempFileChecksAttribute
Marks any suites which are known not to close all the temporary files. This may prevent temp files and folders from being cleaned up after the suite is completed.
LuceneTestCase.WeeklyAttribute
Attribute for tests that should only be run during weekly builds.
LuceneTestFrameworkInitializer
LuceneTestFrameworkInitializer may be subclassed by end users in order to use standard dependency injection techniques for classes under test. A subclass of LuceneTestFrameworkInitializer will be executed automatically by NUnit. To work properly with the Lucene.NET test framework, the subclass must be placed outside of all namespaces, which ensures it is only executed 1 time per test assembly.
The following abstract factories can be overridden for testing purposes:
AbstractionFactory Method NameDefault | |
---|---|
Lucene.Net.Codecs.ICodecFactoryCodecFactoryTestCodecFactory | |
Lucene.Net.Codecs.IDocValuesFormatFactoryDocValuesFormatFactoryTestDocValuesFormatFactory | |
Lucene.Net.Codecs.IPostingsFormatFactoryPostingsFormatFactoryTestPostingsFormatFactory | |
Lucene.Net.Configuration.IConfigurationFactoryConfigurationFactoryLucene.Net.Configuration.TestConfigurationFactory |
Example:
// IMPORTANT: Do not put the initializer in a namespace
public class MyTestFrameworkInitializer : LuceneTestFrameworkInitializer
{
protected override IConfigurationFactory LoadConfigurationFactory()
{
// Inject a custom configuration factory
return new MyConfigurationFactory();
}
protected override void TestFrameworkSetUp()
{
// Inject a custom configuration factory
ConfigurationFactory = new MyConfigurationFactory();
// Do any additional dependency injection setup here
}
}
NullInfoStream
Prints nothing. Just to make sure tests pass w/ and without enabled Lucene.Net.Util.InfoStream without actually making noise.
StackTraceHelper
LUCENENET specific class to normalize stack trace behavior between different .NET Framework and .NET Standard 1.x, which did not support the StackTrace class.
TestUtil
General utility methods for Lucene unit tests.
ThrottledIndexOutput
Intentionally slow Lucene.Net.Store.IndexOutput for testing.
TimeUnits
Time unit constants for use in annotations.