org.apache.lucene.store

## Class BaseDirectoryTestCase

- java.lang.Object
- - org.junit.Assert
  - - org.apache.lucene.util.LuceneTestCase
    - - org.apache.lucene.store.BaseDirectoryTestCase

-     public abstract class BaseDirectoryTestCase
      extends LuceneTestCase

  Base class for per-Directory tests.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.lucene.util.LuceneTestCase

      `LuceneTestCase.AwaitsFix, LuceneTestCase.BadApple, LuceneTestCase.Monster, LuceneTestCase.Nightly, LuceneTestCase.Slow, LuceneTestCase.SuppressCodecs, LuceneTestCase.SuppressFileSystems, LuceneTestCase.SuppressFsync, LuceneTestCase.SuppressReproduceLine, LuceneTestCase.SuppressSysoutChecks, LuceneTestCase.SuppressTempFileChecks, LuceneTestCase.ThrowingRunnable, LuceneTestCase.Weekly`

  - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.util.LuceneTestCase

      `assertsAreEnabled, classRules, DEFAULT_LINE_DOCS_FILE, INFOSTREAM, JENKINS_LARGE_LINE_DOCS_FILE, LEAVE_TEMPORARY, MAYBE_CACHE_POLICY, RANDOM_MULTIPLIER, ruleChain, suiteFailureMarker, SYSPROP_AWAITSFIX, SYSPROP_BADAPPLES, SYSPROP_FAILFAST, SYSPROP_MAXFAILURES, SYSPROP_MONSTER, SYSPROP_NIGHTLY, SYSPROP_SLOW, SYSPROP_WEEKLY, TEST_ASSERTS_ENABLED, TEST_AWAITSFIX, TEST_BADAPPLES, TEST_CODEC, TEST_DIRECTORY, TEST_DOCVALUESFORMAT, TEST_LINE_DOCS_FILE, TEST_MONSTER, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_SLOW, TEST_THROTTLING, TEST_WEEKLY, VERBOSE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseDirectoryTestCase()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract Directory` | `getDirectory(Path path)` A subclass returns the Directory to be tested; if it's an FS-based directory it should point to the specified path, else it can ignore it.
    `void` | `testAlignedLittleEndianLongs()`
    `void` | `testByte()`
    `void` | `testChecksum()`
    `void` | `testCopyBytes()`
    `void` | `testCopyBytesWithThreads()`
    `void` | `testCopyFrom()`
    `void` | `testCreateOutputForExistingFile()`
    `void` | `testCreateTempOutput()`
    `void` | `testDeleteFile()`
    `void` | `testDetectClose()` Make sure directory throws AlreadyClosedException if you try to createOutput after closing.
    `void` | `testDoubleCloseInput()`
    `void` | `testDoubleCloseOutput()`
    `void` | `testFileExistsInListAfterCreated()` LUCENE-1468: once we create an output, we should see it in the dir listing.
    `void` | `testFsyncDoesntCreateNewFiles()`
    `void` | `testIllegalEOF()`
    `void` | `testIndexOutputToString()`
    `void` | `testInt()`
    `void` | `testLargeWrites()` This test that writes larger than the size of the buffer output will correctly increment the file pointer.
    `void` | `testListAllIsSorted()`
    `void` | `testLittleEndianLongsUnderflow()`
    `void` | `testLong()`
    `void` | `testMapOfStrings()`
    `void` | `testNoDir()`
    `void` | `testPendingDeletions()`
    `void` | `testRandomByte()`
    `void` | `testRandomInt()`
    `void` | `testRandomLong()`
    `void` | `testRandomShort()`
    `void` | `testRename()`
    `void` | `testSeekBeyondEndOfFile()`
    `void` | `testSeekPastEOF()`
    `void` | `testSeekToEndOfFile()`
    `void` | `testSeekToEOFThenBack()`
    `void` | `testSetOfStrings()`
    `void` | `testShort()`
    `void` | `testSliceOfSlice()` try to stress slices of slices
    `void` | `testSliceOutOfBounds()`
    `void` | `testString()`
    `void` | `testThreadSafetyInListAll()`
    `void` | `testUnalignedLittleEndianLongs()`
    `void` | `testVInt()`
    `void` | `testVLong()`
    `void` | `testZInt()`
    `void` | `testZLong()`

    - ### Methods inherited from class org.apache.lucene.util.LuceneTestCase

      `addVirusChecker, assertDeletedDocsEquals, assertDocsAndPositionsEnumEquals, assertDocsEnumEquals, assertDocsSkippingEquals, assertDocValuesEquals, assertDocValuesEquals, assertFieldInfosEquals, assertNormsEquals, assertPointsEquals, assertPositionsSkippingEquals, assertReaderEquals, assertReaderStatisticsEquals, assertStoredFieldEquals, assertStoredFieldsEquals, assertTermsEnumEquals, assertTermsEquals, assertTermsEquals, assertTermsStatisticsEquals, assertTermStatsEquals, assertTermVectorsEquals, asSet, assumeFalse, assumeNoException, assumeTrue, assumeWorkingMMapOnWindows, atLeast, atLeast, callStackContains, callStackContains, callStackContainsAnyOf, closeAfterSuite, closeAfterTest, collate, createTempDir, createTempDir, createTempFile, createTempFile, dumpArray, dumpIterator, ensureSaneIWCOnNightly, expectThrows, expectThrows, expectThrows, expectThrowsAnyOf, expectThrowsAnyOf, getBaseTempDirForTestClass, getDataInputStream, getDataPath, getOnlyLeafReader, getTestClass, getTestName, hasWorkingMMapOnWindows, isTestThread, localeForLanguageTag, maybeChangeLiveIndexWriterConfig, maybeWrapReader, newAlcoholicMergePolicy, newAlcoholicMergePolicy, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newDirectory, newDirectory, newDirectory, newDirectory, newDirectory, newField, newField, newFSDirectory, newFSDirectory, newIndexWriterConfig, newIndexWriterConfig, newIndexWriterConfig, newIOContext, newIOContext, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newMaybeVirusCheckingDirectory, newMaybeVirusCheckingFSDirectory, newMergePolicy, newMergePolicy, newMergePolicy, newMockDirectory, newMockDirectory, newMockDirectory, newMockFSDirectory, newMockFSDirectory, newSearcher, newSearcher, newSearcher, newSearcher, newStringField, newStringField, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, overrideDefaultQueryCache, overrideTestDefaultQueryCache, random, randomLocale, randomTimeZone, rarely, rarely, replaceMaxFailureRule, resetDefaultQueryCache, restoreCPUCoreCount, restoreIndexWriterMaxDocs, restoreSpins, runWithRestrictedPermissions, setIndexWriterMaxDocs, setUp, setupCPUCoreCount, setupSpins, slowFileExists, tearDown, usually, usually, wrapReader`

    - ### Methods inherited from class org.junit.Assert

      `assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertThrows, assertThrows, assertTrue, assertTrue, fail, fail`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BaseDirectoryTestCase

          public BaseDirectoryTestCase()

  - ### Method Detail

    - #### getDirectory

          protected abstract Directory getDirectory(Path path)
                                             throws IOException

      A subclass returns the Directory to be tested; if it's an FS-based directory it should point to the specified path, else it can ignore it.
      Throws:
        `IOException`

    - #### testCopyFrom

          public void testCopyFrom()
                            throws Exception

      Throws:
        `Exception`

    - #### testRename

          public void testRename()
                          throws Exception

      Throws:
        `Exception`

    - #### testDeleteFile

          public void testDeleteFile()
                              throws Exception

      Throws:
        `Exception`

    - #### testByte

          public void testByte()
                        throws Exception

      Throws:
        `Exception`

    - #### testShort

          public void testShort()
                         throws Exception

      Throws:
        `Exception`

    - #### testInt

          public void testInt()
                       throws Exception

      Throws:
        `Exception`

    - #### testLong

          public void testLong()
                        throws Exception

      Throws:
        `Exception`

    - #### testAlignedLittleEndianLongs

          public void testAlignedLittleEndianLongs()
                                            throws Exception

      Throws:
        `Exception`

    - #### testUnalignedLittleEndianLongs

          public void testUnalignedLittleEndianLongs()
                                              throws Exception

      Throws:
        `Exception`

    - #### testLittleEndianLongsUnderflow

          public void testLittleEndianLongsUnderflow()
                                              throws Exception

      Throws:
        `Exception`

    - #### testString

          public void testString()
                          throws Exception

      Throws:
        `Exception`

    - #### testVInt

          public void testVInt()
                        throws Exception

      Throws:
        `Exception`

    - #### testVLong

          public void testVLong()
                         throws Exception

      Throws:
        `Exception`

    - #### testZInt

          public void testZInt()
                        throws Exception

      Throws:
        `Exception`

    - #### testZLong

          public void testZLong()
                         throws Exception

      Throws:
        `Exception`

    - #### testSetOfStrings

          public void testSetOfStrings()
                                throws Exception

      Throws:
        `Exception`

    - #### testMapOfStrings

          public void testMapOfStrings()
                                throws Exception

      Throws:
        `Exception`

    - #### testChecksum

          public void testChecksum()
                            throws Exception

      Throws:
        `Exception`

    - #### testDetectClose

          public void testDetectClose()
                               throws Throwable

      Make sure directory throws AlreadyClosedException if you try to createOutput after closing.
      Throws:
        `Throwable`

    - #### testThreadSafetyInListAll

          public void testThreadSafetyInListAll()
                                         throws Exception

      Throws:
        `Exception`

    - #### testFileExistsInListAfterCreated

          public void testFileExistsInListAfterCreated()
                                                throws IOException

      LUCENE-1468: once we create an output, we should see it in the dir listing.
      Throws:
        `IOException`

    - #### testSeekToEOFThenBack

          public void testSeekToEOFThenBack()
                                     throws Exception

      Throws:
        `Exception`

    - #### testIllegalEOF

          public void testIllegalEOF()
                              throws Exception

      Throws:
        `Exception`

    - #### testSeekPastEOF

          public void testSeekPastEOF()
                               throws Exception

      Throws:
        `Exception`

    - #### testSliceOutOfBounds

          public void testSliceOutOfBounds()
                                    throws Exception

      Throws:
        `Exception`

    - #### testNoDir

          public void testNoDir()
                         throws Throwable

      Throws:
        `Throwable`

    - #### testCopyBytes

          public void testCopyBytes()
                             throws Exception

      Throws:
        `Exception`

    - #### testCopyBytesWithThreads

          public void testCopyBytesWithThreads()
                                        throws Exception

      Throws:
        `Exception`

    - #### testFsyncDoesntCreateNewFiles

          public void testFsyncDoesntCreateNewFiles()
                                             throws Exception

      Throws:
        `Exception`

    - #### testRandomLong

          public void testRandomLong()
                              throws Exception

      Throws:
        `Exception`

    - #### testRandomInt

          public void testRandomInt()
                             throws Exception

      Throws:
        `Exception`

    - #### testRandomShort

          public void testRandomShort()
                               throws Exception

      Throws:
        `Exception`

    - #### testRandomByte

          public void testRandomByte()
                              throws Exception

      Throws:
        `Exception`

    - #### testSliceOfSlice

          public void testSliceOfSlice()
                                throws Exception

      try to stress slices of slices
      Throws:
        `Exception`

    - #### testLargeWrites

          public void testLargeWrites()
                               throws IOException

      This test that writes larger than the size of the buffer output will correctly increment the file pointer.
      Throws:
        `IOException`

    - #### testIndexOutputToString

          public void testIndexOutputToString()
                                       throws Throwable

      Throws:
        `Throwable`

    - #### testDoubleCloseOutput

          public void testDoubleCloseOutput()
                                     throws Throwable

      Throws:
        `Throwable`

    - #### testDoubleCloseInput

          public void testDoubleCloseInput()
                                    throws Throwable

      Throws:
        `Throwable`

    - #### testCreateTempOutput

          public void testCreateTempOutput()
                                    throws Throwable

      Throws:
        `Throwable`

    - #### testCreateOutputForExistingFile

          public void testCreateOutputForExistingFile()
                                               throws IOException

      Throws:
        `IOException`

    - #### testSeekToEndOfFile

          public void testSeekToEndOfFile()
                                   throws IOException

      Throws:
        `IOException`

    - #### testSeekBeyondEndOfFile

          public void testSeekBeyondEndOfFile()
                                       throws IOException

      Throws:
        `IOException`

    - #### testPendingDeletions

          public void testPendingDeletions()
                                    throws IOException

      Throws:
        `IOException`

    - #### testListAllIsSorted

          public void testListAllIsSorted()
                                   throws IOException

      Throws:
        `IOException`

Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.