Search in sources :

Example 21 with RAMFile

use of org.apache.lucene.store.RAMFile in project lucene-solr by apache.

the class TestCodecUtil method testWriteTooLongHeader.

public void testWriteTooLongHeader() throws Exception {
    StringBuilder tooLong = new StringBuilder();
    for (int i = 0; i < 128; i++) {
        tooLong.append('a');
    }
    RAMFile file = new RAMFile();
    IndexOutput output = new RAMOutputStream(file, true);
    expectThrows(IllegalArgumentException.class, () -> {
        CodecUtil.writeHeader(output, tooLong.toString(), 5);
    });
}
Also used : RAMFile(org.apache.lucene.store.RAMFile) RAMOutputStream(org.apache.lucene.store.RAMOutputStream) IndexOutput(org.apache.lucene.store.IndexOutput)

Aggregations

RAMFile (org.apache.lucene.store.RAMFile)21 RAMOutputStream (org.apache.lucene.store.RAMOutputStream)21 IndexOutput (org.apache.lucene.store.IndexOutput)16 RAMInputStream (org.apache.lucene.store.RAMInputStream)15 BufferedChecksumIndexInput (org.apache.lucene.store.BufferedChecksumIndexInput)11 ChecksumIndexInput (org.apache.lucene.store.ChecksumIndexInput)11 IndexInput (org.apache.lucene.store.IndexInput)7 CorruptIndexException (org.apache.lucene.index.CorruptIndexException)5 IOException (java.io.IOException)4 Document (org.apache.lucene.document.Document)4 DirectoryReader (org.apache.lucene.index.DirectoryReader)4 IndexWriter (org.apache.lucene.index.IndexWriter)4 LeafReader (org.apache.lucene.index.LeafReader)4 RandomIndexWriter (org.apache.lucene.index.RandomIndexWriter)4 Directory (org.apache.lucene.store.Directory)4 TreeSet (java.util.TreeSet)2 SortedNumericDocValuesField (org.apache.lucene.document.SortedNumericDocValuesField)2 SortedSetDocValuesField (org.apache.lucene.document.SortedSetDocValuesField)2 SortedNumericDocValues (org.apache.lucene.index.SortedNumericDocValues)2 SortedSetDocValues (org.apache.lucene.index.SortedSetDocValues)2