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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier 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 FileCreates a temp directory withintempDir.protected FilecreateTempFile(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
-
testName
public org.junit.rules.TestName testName
-
-
Constructor Details
-
TestSupport
public TestSupport()
-
-
Method Details
-
setup
Creates the temp directory and list for resource handlers.- Throws:
IOException
-
cleanup
Closes all the registered resources handlers and deletes the temp directory.- Throws:
IOException
-
createTempFile
Creates a temp file withintempDirwith given name.- Throws:
IOException
-
createTempDirectory
Creates a temp directory withintempDir.- Throws:
IOException
-
createWritableResourceHandler
Creates an emptyDirectoryResourceHandler.- Throws:
IOException
-
testResourceHandler
Creates a "test"ResourceHandlerthat contains predefined files, is mapped to test resources under given name.- Throws:
IOException
-
loadRecordsByType
protected Map<Record.Type,List<Record>> loadRecordsByType(ChunkReader chunkReader) throws IOException ConsumesChunkReaderand creates a map "by type" with records.- Throws:
IOException
-
countRecordsByType
ConsumesChunkReaderand creates a map "by type" with record type counts.- Throws:
IOException
-