public class TestSupport extends Object
| Modifier and Type | Field and Description |
|---|---|
org.junit.rules.TestName |
testName |
| Constructor and Description |
|---|
TestSupport() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Closes all the registered resources handlers and deletes the temp directory.
|
protected Map<org.apache.maven.index.reader.Record.Type,Integer> |
countRecordsByType(org.apache.maven.index.reader.ChunkReader chunkReader)
Consumes
ChunkReader and creates a map "by type" with record type counts. |
protected File |
createTempDirectory()
Creates a temp directory within
tempDir. |
protected File |
createTempFile(String name)
Creates a temp file within
tempDir with given name. |
protected org.apache.maven.index.reader.WritableResourceHandler |
createWritableResourceHandler()
Creates an empty
DirectoryResourceHandler. |
protected Map<org.apache.maven.index.reader.Record.Type,List<org.apache.maven.index.reader.Record>> |
loadRecordsByType(org.apache.maven.index.reader.ChunkReader chunkReader)
Consumes
ChunkReader and creates a map "by type" with records. |
void |
setup()
Creates the temp directory and list for resource handlers.
|
protected org.apache.maven.index.reader.ResourceHandler |
testResourceHandler(String name)
Creates a "test"
ResourceHandler that contains predefined files, is mapped to test resources under given
name. |
public void setup()
throws IOException
IOExceptionpublic void cleanup()
throws IOException
IOExceptionprotected File createTempFile(String name) throws IOException
tempDir with given name.IOExceptionprotected File createTempDirectory() throws IOException
tempDir.IOExceptionprotected org.apache.maven.index.reader.WritableResourceHandler createWritableResourceHandler()
throws IOException
DirectoryResourceHandler.IOExceptionprotected org.apache.maven.index.reader.ResourceHandler testResourceHandler(String name) throws IOException
ResourceHandler that contains predefined files, is mapped to test resources under given
name.IOExceptionprotected 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
ChunkReader and creates a map "by type" with records.IOExceptionprotected Map<org.apache.maven.index.reader.Record.Type,Integer> countRecordsByType(org.apache.maven.index.reader.ChunkReader chunkReader) throws IOException
ChunkReader and creates a map "by type" with record type counts.IOExceptionCopyright © 2002–2022 The Apache Software Foundation. All rights reserved.