ExtractorAsserts
@UnstableApi
class ExtractorAsserts
Assertion methods for Extractor.
Summary
Nested types |
|---|
|
A config for the assertions made (e.g. dump file location). |
|
Builder for |
|
A |
interface ExtractorAsserts.ExtractorFactoryA factory for |
|
A config of different environments to simulate and extractor behaviours to test. |
Constants |
|
|---|---|
const Int |
Public functions |
|
|---|---|
java-static Unit |
assertBehavior(Asserts that an extractor consumes valid input data successfully under the conditions specified by |
java-static Unit |
assertBehavior(Asserts that an extractor consumes valid input data successfully under the conditions specified by |
java-static Unit |
assertBehavior(Asserts that an extractor consumes valid input data successfully under the conditions specified by |
java-static Unit |
assertBehavior(Asserts that an extractor consumes valid input data successfully under the conditions specified by |
java-static Unit |
assertSniff(Asserts that |
java-static Unit |
assertSniff(Asserts that |
java-static ImmutableList<ExtractorAsserts.SimulationConfig!>! |
configs()Returns a list of arrays containing |
java-static (Mutable)List<Array<Any!>!>! |
Returns a list of arrays containing |
Constants
Public functions
assertBehavior
java-static fun assertBehavior(
factory: ExtractorAsserts.ExtractorFactory!,
file: String!,
simulationConfig: ExtractorAsserts.SimulationConfig!
): Unit
Asserts that an extractor consumes valid input data successfully under the conditions specified by simulationConfig.
The output of the extractor is compared against prerecorded dump files whose names are derived from the file parameter as specified in the docs for dumpFilesPrefix.
| Parameters | |
|---|---|
factory: ExtractorAsserts.ExtractorFactory! |
An |
file: String! |
The path to the input sample. |
simulationConfig: ExtractorAsserts.SimulationConfig! |
Details on the environment to simulate and behaviours to assert. |
| Throws | |
|---|---|
java.io.IOException |
If reading from the input fails. |
assertBehavior
java-static fun assertBehavior(
factory: ExtractorAsserts.ExtractorFactory!,
file: String!,
assertionConfig: ExtractorAsserts.AssertionConfig!,
simulationConfig: ExtractorAsserts.SimulationConfig!
): Unit
Asserts that an extractor consumes valid input data successfully under the conditions specified by simulationConfig.
The output of the extractor is compared against prerecorded dump files.
| Parameters | |
|---|---|
factory: ExtractorAsserts.ExtractorFactory! |
An |
file: String! |
The input file to pass to the extractor. |
assertionConfig: ExtractorAsserts.AssertionConfig! |
Details of how to read and process the source and dump files. |
simulationConfig: ExtractorAsserts.SimulationConfig! |
Details on the environment to simulate and behaviours to assert. |
| Throws | |
|---|---|
java.io.IOException |
If reading from the input fails. |
assertBehavior
java-static fun assertBehavior(
factory: ExtractorAsserts.ExtractorFactory!,
file: String!,
peekLimit: Int,
simulationConfig: ExtractorAsserts.SimulationConfig!
): Unit
Asserts that an extractor consumes valid input data successfully under the conditions specified by simulationConfig.
The output of the extractor is compared against prerecorded dump files whose names are derived from the file parameter as specified in the docs for dumpFilesPrefix.
| Parameters | |
|---|---|
factory: ExtractorAsserts.ExtractorFactory! |
An |
file: String! |
The path to the input sample. |
peekLimit: Int |
The limit that |
simulationConfig: ExtractorAsserts.SimulationConfig! |
Details on the environment to simulate and behaviours to assert. |
| Throws | |
|---|---|
java.io.IOException |
If reading from the input fails. |
assertBehavior
java-static fun assertBehavior(
factory: ExtractorAsserts.ExtractorFactory!,
file: String!,
peekLimit: Int,
assertionConfig: ExtractorAsserts.AssertionConfig!,
simulationConfig: ExtractorAsserts.SimulationConfig!
): Unit
Asserts that an extractor consumes valid input data successfully under the conditions specified by simulationConfig.
The output of the extractor is compared against prerecorded dump files.
| Parameters | |
|---|---|
factory: ExtractorAsserts.ExtractorFactory! |
An |
file: String! |
The input file to pass to the extractor. |
peekLimit: Int |
The limit that |
assertionConfig: ExtractorAsserts.AssertionConfig! |
Details of how to read and process the source and dump files. |
simulationConfig: ExtractorAsserts.SimulationConfig! |
Details on the environment to simulate and behaviours to assert. |
| Throws | |
|---|---|
java.io.IOException |
If reading from the input fails. |
assertSniff
java-static fun assertSniff(
extractor: Extractor!,
input: FakeExtractorInput!,
expectedResult: Boolean
): Unit
Asserts that sniff returns the expectedResult for a given input, retrying repeatedly when SimulatedIOException is thrown.
| Parameters | |
|---|---|
extractor: Extractor! |
The extractor to test. |
input: FakeExtractorInput! |
The extractor input. |
expectedResult: Boolean |
The expected return value. |
| Throws | |
|---|---|
java.io.IOException |
If reading from the input fails. |
assertSniff
java-static fun assertSniff(
extractor: Extractor!,
file: String!,
peekLimit: Int,
expectedResult: Boolean
): Unit
Asserts that sniff returns the expectedResult for a given file, retrying repeatedly when SimulatedIOException is thrown.
| Parameters | |
|---|---|
extractor: Extractor! |
The extractor to test. |
file: String! |
The path to the input sample. |
peekLimit: Int |
The limit that |
expectedResult: Boolean |
The expected return value. |
| Throws | |
|---|---|
java.io.IOException |
If reading from the input fails. |
configs
java-static fun configs(): ImmutableList<ExtractorAsserts.SimulationConfig!>!
Returns a list of arrays containing SimulationConfig objects to exercise different extractor paths.
This is intended to be used from tests using ParameterizedRobolectricTestRunner or org.junit.runners.Parameterized.
configsNoSniffing
java-static fun configsNoSniffing(): (Mutable)List<Array<Any!>!>!
Returns a list of arrays containing SimulationConfig objects to exercise different extractor paths in which the input is not sniffed.
This is intended to be used from tests using ParameterizedRobolectricTestRunner or org.junit.runners.Parameterized.