public class BaseJUnit4IteratorTest extends Object
Users should extend this class and implement a static method using the @Parameters
annotation.
@Parameters
public static Object[][] data() {
IteratorTestInput input = createIteratorInput();
IteratorTestOutput expectedOutput = createIteratorOutput();
List<IteratorTestCase> testCases = createTestCases();
return BaseJUnit4IteratorTest.createParameters(input, expectedOutput, testCases);
}
| Modifier and Type | Field and Description |
|---|---|
IteratorTestRunner |
runner |
| Constructor and Description |
|---|
BaseJUnit4IteratorTest(IteratorTestInput input,
IteratorTestOutput expectedOutput,
IteratorTestCase testCase) |
| Modifier and Type | Method and Description |
|---|---|
static Object[][] |
createParameters(IteratorTestInput input,
IteratorTestOutput output,
Collection<IteratorTestCase> testCases)
A helper function to convert input, output and a list of test cases into a two-dimensional
array for JUnit's Parameterized runner.
|
void |
testIterator() |
public final IteratorTestRunner runner
public BaseJUnit4IteratorTest(IteratorTestInput input, IteratorTestOutput expectedOutput, IteratorTestCase testCase)
public static Object[][] createParameters(IteratorTestInput input, IteratorTestOutput output, Collection<IteratorTestCase> testCases)
input - The inputoutput - The outputtestCases - A list of desired test cases to run.public void testIterator()
Copyright © 2011–2019 The Apache Software Foundation. All rights reserved.