ExtractorAsserts
@UnstableApi
class ExtractorAsserts
Assertion methods for Extractor
.
Summary
Nested types |
---|
A config for the assertions made (e.g. dump file location). |
Builder for |
interface ExtractorAsserts.ExtractorFactory A factory for |
A config of different environments to simulate and extractor behaviours to test. |
Public functions |
|
---|---|
java-static Unit |
assertAllBehaviors( Asserts that an extractor behaves correctly given valid input data. |
java-static Unit |
assertAllBehaviors( Asserts that an extractor behaves correctly given valid input data: |
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 successfully under the conditions specified by |
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 |
Public functions
assertAllBehaviors
java-static fun assertAllBehaviors(
factory: ExtractorAsserts.ExtractorFactory!,
file: String!
): Unit
Asserts that an extractor behaves correctly given valid input data.
- Calls
seek
andrelease
without callinginit
to check these calls do not fail. - Calls
assertOutput
with all possible combinations of "simulate" parameters.
Parameters | |
---|---|
factory: ExtractorAsserts.ExtractorFactory! |
An |
file: String! |
The path to the input sample. |
Throws | |
---|---|
java.io.IOException |
If reading from the input fails. |
assertAllBehaviors
java-static fun assertAllBehaviors(
factory: ExtractorAsserts.ExtractorFactory!,
file: String!,
dumpFilesPrefix: String!
): Unit
Asserts that an extractor behaves correctly given valid input data:
- Calls
seek
andrelease
without callinginit
to check these calls do not fail. - Calls
assertOutput
with all possible combinations of "simulate" parameters.
Parameters | |
---|---|
factory: ExtractorAsserts.ExtractorFactory! |
An |
file: String! |
The path to the input sample. |
dumpFilesPrefix: String! |
The dump files prefix appended to the dump files path. |
Throws | |
---|---|
java.io.IOException |
If reading from the input fails. |
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 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. |
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. |
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
.