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.countRecordsByType(org.apache.maven.index.reader.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 org.apache.maven.index.reader.WritableResourceHandlerCreates an emptyDirectoryResourceHandler.loadRecordsByType(org.apache.maven.index.reader.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
protected org.apache.maven.index.reader.WritableResourceHandler createWritableResourceHandler() throws IOExceptionCreates 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<org.apache.maven.index.reader.Record.Type,List<org.apache.maven.index.reader.Record>> loadRecordsByType(org.apache.maven.index.reader.ChunkReader chunkReader) throws IOException ConsumesChunkReaderand creates a map "by type" with records.- Throws:
IOException
-
countRecordsByType
protected Map<org.apache.maven.index.reader.Record.Type,Integer> countRecordsByType(org.apache.maven.index.reader.ChunkReader chunkReader) throws IOException ConsumesChunkReaderand creates a map "by type" with record type counts.- Throws:
IOException
-