Package org.apache.maven.index.reader
Class TestSupport
java.lang.Object
org.apache.maven.index.reader.TestSupport
- Direct Known Subclasses:
- ChunkReaderTest,- IndexReaderTest,- IndexWriterTest,- TransformTest
Test support.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcleanup()Closes all the registered resources handlers and deletes the temp directory.protected Map<Record.Type, Integer> countRecordsByType(ChunkReader chunkReader) ConsumesChunkReaderand creates a map "by type" with record type counts.protected PathCreates a temp directory withintempDir.protected PathcreateTempFile(String name) Creates a temp file withintempDirwith given name.protected WritableResourceHandlerCreates an emptyDirectoryResourceHandler.protected Map<Record.Type, List<Record>> loadRecordsByType(ChunkReader chunkReader) ConsumesChunkReaderand creates a map "by type" with records.voidsetup()Creates the temp directory and list for resource handlers.protected DirectoryResourceHandlertestResourceHandler(String name) Creates a "test"ResourceHandlerthat contains predefined files, is mapped to test resources under given name.
- 
Field Details- 
testNamepublic org.junit.rules.TestName testName
 
- 
- 
Constructor Details- 
TestSupportpublic TestSupport()
 
- 
- 
Method Details- 
setupCreates the temp directory and list for resource handlers.- Throws:
- IOException
 
- 
cleanupCloses all the registered resources handlers and deletes the temp directory.- Throws:
- IOException
 
- 
createTempFileCreates a temp file withintempDirwith given name.- Throws:
- IOException
 
- 
createTempDirectoryCreates a temp directory withintempDir.- Throws:
- IOException
 
- 
createWritableResourceHandlerCreates an emptyDirectoryResourceHandler.- Throws:
- IOException
 
- 
testResourceHandlerCreates a "test"ResourceHandlerthat contains predefined files, is mapped to test resources under given name.- Throws:
- IOException
 
- 
loadRecordsByTypeprotected Map<Record.Type,List<Record>> loadRecordsByType(ChunkReader chunkReader) throws IOException ConsumesChunkReaderand creates a map "by type" with records.- Throws:
- IOException
 
- 
countRecordsByTypeConsumesChunkReaderand creates a map "by type" with record type counts.- Throws:
- IOException
 
 
-