• API

    Show / Hide Table of Contents

    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.

    This is a Lucene.NET INTERNAL API, use at your own risk

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

    Contains a list of the Func<IConcurrentMergeSchedulers> to be tested. Delegate method allows them to be created on their target thread instead of the test thread and also ensures a separate instance is created in each case (which can affect the result of the test).

    The Lucene.Net.Index.TaskMergeScheduler is only rarely included.

    LUCENENET specific for injection into tests (i.e. using NUnit.Framework.ValueSourceAttribute)

    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.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk

    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.

    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)