Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.accumulo.core.client.IteratorSetting;
Expand Down Expand Up @@ -193,8 +194,19 @@ public void testPrettyPrint() {
assertTrue(pp.contains("update: name:last value doe"));
assertTrue(pp.contains("update: name:first value john"));
iters = c1.getIterators();
assertTrue(pp.contains("condition: " + FAMILY + ":" + QUALIFIER + " value: " + VALUE
+ " iterator: '" + iters[0] + "' '" + iters[1] + "'"));
assertTrue(pp.contains("condition: " + FAMILY + ":" + QUALIFIER + " value: " + VALUE));
String iterSection = pp.substring(pp.indexOf("iterator:"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious if this is a false positive as the iters object is an array, which is ordered.

for (IteratorSetting iter : iters) {
Map<String,String> props = iter.getOptions();

assertTrue(iterSection.contains("name:" + iter.getName()));
assertTrue(iterSection.contains("class:" + iter.getIteratorClass()));
assertTrue(iterSection.contains("priority:" + iter.getPriority()));

for (Map.Entry<String,String> e : props.entrySet()) {
assertTrue(iterSection.contains(e.getKey() + "=" + e.getValue()));
}
}

// all conditions together
c1 = new Condition(FAMILY2, QUALIFIER2).setValue(VALUE).setVisibility(CVIS2)
Expand All @@ -208,8 +220,20 @@ public void testPrettyPrint() {
assertTrue(pp.contains("update: name:first value john"));
iters = c1.getIterators();
assertTrue(pp.contains("condition: " + FAMILY2 + ":" + QUALIFIER2 + " value: " + VALUE
+ " visibility: '" + c1.getVisibility() + "' timestamp: '" + TIMESTAMP + "' iterator: '"
+ iters[0] + "'"));
+ " visibility: '" + c1.getVisibility() + "' timestamp: '" + TIMESTAMP));

iterSection = pp.substring(pp.indexOf("iterator:"));
for (IteratorSetting iter : iters) {
Map<String,String> props = iter.getOptions();

assertTrue(iterSection.contains("name:" + iter.getName()));
assertTrue(iterSection.contains("class:" + iter.getIteratorClass()));
assertTrue(iterSection.contains("priority:" + iter.getPriority()));

for (Map.Entry<String,String> e : props.entrySet()) {
assertTrue(iterSection.contains(e.getKey() + "=" + e.getValue()));
}
}
}

@Test
Expand Down