use of org.apache.accumulo.iteratortest.IteratorTestOutput in project accumulo by apache.
the class ReSeekTestCase method test.
@Override
public IteratorTestOutput test(IteratorTestInput testInput) {
final SortedKeyValueIterator<Key, Value> skvi = IteratorTestUtil.instantiateIterator(testInput);
final SortedKeyValueIterator<Key, Value> source = IteratorTestUtil.createSource(testInput);
try {
skvi.init(source, testInput.getIteratorOptions(), new SimpleIteratorEnvironment());
skvi.seek(testInput.getRange(), testInput.getFamilies(), testInput.isInclusive());
return new IteratorTestOutput(consume(skvi, testInput));
} catch (IOException e) {
return new IteratorTestOutput(e);
}
}
use of org.apache.accumulo.iteratortest.IteratorTestOutput in project accumulo by apache.
the class YieldingTestCase method test.
@Override
public IteratorTestOutput test(IteratorTestInput testInput) {
final SortedKeyValueIterator<Key, Value> skvi = IteratorTestUtil.instantiateIterator(testInput);
final SortedKeyValueIterator<Key, Value> source = IteratorTestUtil.createSource(testInput);
try {
skvi.init(source, testInput.getIteratorOptions(), new SimpleIteratorEnvironment());
YieldCallback<Key> yield = new YieldCallback<>();
skvi.enableYielding(yield);
skvi.seek(testInput.getRange(), testInput.getFamilies(), testInput.isInclusive());
return new IteratorTestOutput(consume(testInput, skvi, yield));
} catch (IOException e) {
return new IteratorTestOutput(e);
}
}
use of org.apache.accumulo.iteratortest.IteratorTestOutput in project accumulo by apache.
the class JUnitFrameworkTest method parameters.
@Parameters
public static Object[][] parameters() {
IteratorTestInput input = getIteratorInput();
IteratorTestOutput output = getIteratorOutput();
List<IteratorTestCase> tests = Collections.singletonList(new NoopIteratorTestCase());
return BaseJUnit4IteratorTest.createParameters(input, output, tests);
}
use of org.apache.accumulo.iteratortest.IteratorTestOutput in project accumulo by apache.
the class DeepCopyTestCase method test.
@Override
public IteratorTestOutput test(IteratorTestInput testInput) {
final SortedKeyValueIterator<Key, Value> skvi = IteratorTestUtil.instantiateIterator(testInput);
final SortedKeyValueIterator<Key, Value> source = IteratorTestUtil.createSource(testInput);
try {
skvi.init(source, testInput.getIteratorOptions(), new SimpleIteratorEnvironment());
SortedKeyValueIterator<Key, Value> copy = skvi.deepCopy(new SimpleIteratorEnvironment());
copy.seek(testInput.getRange(), testInput.getFamilies(), testInput.isInclusive());
return new IteratorTestOutput(consume(copy));
} catch (IOException e) {
return new IteratorTestOutput(e);
}
}
use of org.apache.accumulo.iteratortest.IteratorTestOutput in project accumulo by apache.
the class IsolatedDeepCopiesTestCase method test.
@Override
public IteratorTestOutput test(IteratorTestInput testInput) {
final SortedKeyValueIterator<Key, Value> skvi = IteratorTestUtil.instantiateIterator(testInput);
final SortedKeyValueIterator<Key, Value> source = IteratorTestUtil.createSource(testInput);
try {
skvi.init(source, testInput.getIteratorOptions(), new SimpleIteratorEnvironment());
SortedKeyValueIterator<Key, Value> copy1 = skvi.deepCopy(new SimpleIteratorEnvironment());
SortedKeyValueIterator<Key, Value> copy2 = copy1.deepCopy(new SimpleIteratorEnvironment());
Range seekRange = testInput.getRange();
Collection<ByteSequence> seekColumnFamilies = testInput.getFamilies();
boolean seekInclusive = testInput.isInclusive();
skvi.seek(testInput.getRange(), seekColumnFamilies, seekInclusive);
copy1.seek(testInput.getRange(), seekColumnFamilies, seekInclusive);
copy2.seek(testInput.getRange(), seekColumnFamilies, seekInclusive);
TreeMap<Key, Value> output = consumeMany(new ArrayList<>(Arrays.asList(skvi, copy1, copy2)), seekRange, seekColumnFamilies, seekInclusive);
return new IteratorTestOutput(output);
} catch (IOException e) {
return new IteratorTestOutput(e);
}
}
Aggregations