Namespace Lucene.Net.Store
Classes
BaseDirectoryTestCase
Base class for per-Directory tests.
BaseDirectoryWrapper
Calls check index on dispose.
Failure
Objects that represent fail-able conditions. Objects of a derived class are created and registered with the mock directory. After register, each object will be invoked once for each first write of a file, giving the object a chance to throw an IOException.
FakeIOException
Use this when throwing fake IOException, e.g. from Failure.
MockDirectoryWrapper
This is a Directory Wrapper that adds methods intended to be used only by unit tests. It also adds a number of features useful for testing:
- Instances created by NewDirectory() are tracked to ensure they are disposed by the test.
- When a MockDirectoryWrapper is disposed, it will throw an exception if it has any open files against it (with a stacktrace indicating where they were opened from).
- When a MockDirectoryWrapper is disposed, it runs Lucene.Net.Index.CheckIndex to test if the index was corrupted.
- MockDirectoryWrapper simulates some "features" of Windows, such as refusing to write/delete to open files.
MockIndexInputWrapper
Used by MockDirectoryWrapper to create an input stream that keeps track of when it's been disposed.
MockIndexOutputWrapper
Used by MockDirectoryWrapper to create an output stream that will throw an IOException on fake disk full, track max disk space actually used, and maybe throw random IOExceptions.
MockLockFactoryWrapper
Used by MockDirectoryWrapper to wrap another factory and track open locks.
TestHelper
This class provides access to namespace-level features defined in the Store namespace. It is used for testing only.
Enums
Throttling
Enum for controlling hard disk throttling. Set via Throttling
WARNING: can make tests very slow.