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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanup()
Closes all the registered resources handlers and deletes the temp directory.countRecordsByType
(org.apache.maven.index.reader.ChunkReader chunkReader) ConsumesChunkReader
and creates a map "by type" with record type counts.protected File
Creates a temp directory withintempDir
.protected File
createTempFile
(String name) Creates a temp file withintempDir
with given name.protected org.apache.maven.index.reader.WritableResourceHandler
Creates an emptyDirectoryResourceHandler
.loadRecordsByType
(org.apache.maven.index.reader.ChunkReader chunkReader) ConsumesChunkReader
and creates a map "by type" with records.void
setup()
Creates the temp directory and list for resource handlers.protected DirectoryResourceHandler
testResourceHandler
(String name) Creates a "test"ResourceHandler
that 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 withintempDir
with 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"ResourceHandler
that 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 ConsumesChunkReader
and 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 ConsumesChunkReader
and creates a map "by type" with record type counts.- Throws:
IOException
-