*/
@Test
public void testIteratorOptionEncoding() throws Throwable {
String key = "colon:delimited:key";
String value = "comma,delimited,value";
IteratorSetting someSetting = new IteratorSetting(1, "iterator", "Iterator.class");
someSetting.addOption(key, value);
Job job = new Job();
AccumuloInputFormat.addIterator(job.getConfiguration(), someSetting);
final String rawConfigOpt = new AccumuloIteratorOption("iterator", key, value).toString();
assertEquals(rawConfigOpt, job.getConfiguration().get("AccumuloInputFormat.iterators.options"));
List<AccumuloIteratorOption> opts = AccumuloInputFormat.getIteratorOptions(job.getConfiguration());
assertEquals(1, opts.size());
assertEquals(opts.get(0).getKey(), key);
assertEquals(opts.get(0).getValue(), value);
someSetting.addOption(key + "2", value);
someSetting.setPriority(2);
someSetting.setName("it2");
AccumuloInputFormat.addIterator(job.getConfiguration(), someSetting);
opts = AccumuloInputFormat.getIteratorOptions(job.getConfiguration());
assertEquals(3, opts.size());
for (AccumuloIteratorOption opt : opts) {
assertEquals(opt.getKey().substring(0, key.length()), key);