assertEquals("1:org.apache.accumulo.core.iterators.WholeRowIterator:WholeRow", iterators);
}
@Test
public void testAddIterator() {
JobContext job = new JobContext(new Configuration(), new JobID());
AccumuloInputFormat.addIterator(job.getConfiguration(), new IteratorSetting(1, "WholeRow", WholeRowIterator.class));
AccumuloInputFormat.addIterator(job.getConfiguration(), new IteratorSetting(2, "Versions", "org.apache.accumulo.core.iterators.VersioningIterator"));
IteratorSetting iter = new IteratorSetting(3, "Count", "org.apache.accumulo.core.iterators.CountingIterator");
iter.addOption("v1", "1");
iter.addOption("junk", "\0omg:!\\xyzzy");
AccumuloInputFormat.addIterator(job.getConfiguration(), iter);
List<AccumuloIterator> list = AccumuloInputFormat.getIterators(job.getConfiguration());
// Check the list size
assertTrue(list.size() == 3);
// Walk the list and make sure our settings are correct
AccumuloIterator setting = list.get(0);
assertEquals(1, setting.getPriority());
assertEquals("org.apache.accumulo.core.iterators.user.WholeRowIterator", setting.getIteratorClass());
assertEquals("WholeRow", setting.getIteratorName());
setting = list.get(1);
assertEquals(2, setting.getPriority());
assertEquals("org.apache.accumulo.core.iterators.VersioningIterator", setting.getIteratorClass());
assertEquals("Versions", setting.getIteratorName());
setting = list.get(2);
assertEquals(3, setting.getPriority());
assertEquals("org.apache.accumulo.core.iterators.CountingIterator", setting.getIteratorClass());
assertEquals("Count", setting.getIteratorName());
List<AccumuloIteratorOption> iteratorOptions = AccumuloInputFormat.getIteratorOptions(job.getConfiguration());
assertEquals(2, iteratorOptions.size());
assertEquals("Count", iteratorOptions.get(0).getIteratorName());
assertEquals("Count", iteratorOptions.get(1).getIteratorName());
assertEquals("v1", iteratorOptions.get(0).getKey());
assertEquals("1", iteratorOptions.get(0).getValue());