checkScannerYieldValues(builder.build(), possibleValues);
}
@Test
public void testPassOneRegexMatchFilter() throws Exception {
BaseDao<GenericRecord> dao = new GenericAvroDao(tablePool, tableName,
recordString);
Set<String> possibleValues = new HashSet<String>();
for (int i = 0; i < 10; i++) {
possibleValues.add("field1_2" + Integer.toString(i));
}
for (int i = 0; i < 10; i++) {
possibleValues.add("field1_5" + Integer.toString(i));
}
EntityScannerBuilder<GenericRecord> builder = dao.getScannerBuilder();
builder.addFilter(new RegexEntityFilter(dao.getEntitySchema(), dao
.getEntityMapper().getEntitySerDe(), "field1", "field1_2\\d"));
builder.addFilter(new RegexEntityFilter(dao.getEntitySchema(), dao
.getEntityMapper().getEntitySerDe(), "field1", "field1_5\\d"));
builder.setPassAllFilters(false);
checkScannerYieldValues(builder.build(), possibleValues);
}