Package org.apache.lucene.tests.util
General test support. The primary class is
LuceneTestCase
,
which extends JUnit with additional functionality.-
Interface Summary Interface Description LuceneTestCase.ThrowingConsumer<T> AConsumer
that can throw any checked exception.LuceneTestCase.ThrowingRunnable A runnable that can throw any checked exception.TestRuleIgnoreTestSuites.NestedTestSuite Marker interface for nested suites that should be ignored if executed in stand-alone mode. -
Class Summary Class Description BaseBitSetTestCase<T extends BitSet> Base test case for BitSets.BaseDocIdSetTestCase<T extends DocIdSet> Base test class forDocIdSet
s.English Converts numbers to english strings for testing.FailOnNonBulkMergesInfoStream Hackidy-Häck-Hack to cause a test to fail on non-bulk mergesFailureMarker ARunListener
that detects suite/ test failures.LineFileDocs Minimal port of benchmark's LneDocSource + DocMaker, so tests can enum docs from a line file created by benchmark's WriteLineDoc taskLuceneJUnit3MethodProvider Backwards compatible test* method provider (public, non-static).LuceneTestCase Base class for all Lucene unit tests, Junit3 or Junit4 variant.NullInfoStream Prints nothing.QuickPatchThreadsFilter Last minute patches.RamUsageTester Crawls object graph to collect RAM usage for testingRamUsageTester.Accumulator An accumulator of object references.Rethrow Sneaky: rethrowing checked exceptions as unchecked ones.RunListenerPrintReproduceInfo A suite listener printing a "reproduce string".StringMockResourceLoader Fake resource loader for tests: works if you want to fake reading a single fileTestRuleAssertionsRequired Require assertions for Lucene packages.TestRuleIgnoreAfterMaxFailures This rule keeps a count of failed tests (suites) and will result in anAssumptionViolatedException
after a given number of failures for all tests following this condition.TestRuleIgnoreTestSuites This rule will cause the suite to be assumption-ignored if the test class implements a given marker interface and a special property is not set.TestRuleLimitSysouts This test rule serves two purposes: it fails the test if it prints too much to stdout and stderr (tests that chatter too much are discouraged) the rule ensures an absolute hard limit of stuff written to stdout and stderr to prevent accidental infinite loops from filling all available disk space with persisted output.TestRuleMarkFailure A rule for marking failed tests and suites.TestRuleRestoreSystemProperties Restore a given set of system properties to a snapshot taken at the beginning of the rule.TestRuleStoreClassName Stores the suite name so you can retrieve it fromTestRuleStoreClassName.getTestClass()
TestSecurityManager ASecurityManager
that prevents tests callingSystem.exit(int)
.TestUtil General utility methods for Lucene unit tests.ThrottledIndexOutput Intentionally slow IndexOutput for testing.TimeUnits time unit constants for use in annotations.VerifyTestClassNamingConvention Enforce test naming convention. -
Annotation Types Summary Annotation Type Description LuceneTestCase.AwaitsFix Annotation for tests which exhibit a known issue and are temporarily disabled.LuceneTestCase.BadApple Annotation for tests that fail frequently and are not executed in Jenkins builds to not spam mailing lists with false reports.LuceneTestCase.Monster Annotation for monster tests that require special setup (e.g.LuceneTestCase.Nightly Annotation for tests that should only be run during nightly builds.LuceneTestCase.SuppressCodecs Annotation for test classes that should avoid certain codec types (because they are expensive, for example).LuceneTestCase.SuppressFileSystems Annotation for test classes that should avoid mock filesystem types (because they test a bug that only happens on linux, for example).LuceneTestCase.SuppressFsync Annotation for test classes that should avoid always omit actual fsync calls from reaching the filesystem.LuceneTestCase.SuppressReproduceLine Suppress the defaultreproduce with: ant test...
Your own listener can be added as needed for your build.LuceneTestCase.SuppressSysoutChecks IgnoreTestRuleLimitSysouts
for any suite which is known to print over the default limit of bytes toSystem.out
orSystem.err
.LuceneTestCase.SuppressTempFileChecks Marks any suites which are known not to close all the temporary files.LuceneTestCase.Weekly Annotation for tests that should only be run during weekly buildsTestRuleLimitSysouts.Limit An annotation specifying the limit of bytes per class.