count = 0;
boolean sawZero = false;
if (VERBOSE) {
System.out.println("\ngetPayloadSpans test");
}
Spans pspans = MultiSpansWrapper.wrap(is.getTopReaderContext(), snq);
while (pspans.next()) {
if (VERBOSE) {
System.out.println("doc " + pspans.doc() + ": span " + pspans.start()
+ " to " + pspans.end());
}
Collection<byte[]> payloads = pspans.getPayload();
sawZero |= pspans.start() == 0;
for (byte[] bytes : payloads) {
count++;
if (VERBOSE) {
System.out.println(" payload: " + new String(bytes, "UTF-8"));
}
}
}
assertTrue(sawZero);
assertEquals(5, count);
// System.out.println("\ngetSpans test");
Spans spans = MultiSpansWrapper.wrap(is.getTopReaderContext(), snq);
count = 0;
sawZero = false;
while (spans.next()) {
count++;
sawZero |= spans.start() == 0;
// System.out.println(spans.doc() + " - " + spans.start() + " - " +
// spans.end());
}
assertEquals(4, count);
assertTrue(sawZero);