Report report = new Report();
report.setColumnFilters(columnFilters);
LongComparator expectedComp1 = new LongComparator(123l, 0, -1);
SingleColumnValueFilter expectedFilter1 = new SingleColumnValueFilter(
Bytes.toBytes("cf1"), Bytes.toBytes("qualifier"),
CompareOp.GREATER_OR_EQUAL, expectedComp1);
expectedFilter1.setFilterIfMissing(true);
SubBinaryComparator expectedComp2 = new SubBinaryComparator(Bytes.toBytes("123"), 0, -1);
SingleColumnValueFilter expectedFilter2 = new SingleColumnValueFilter(
Bytes.toBytes("cf2"), Bytes.toBytes("qualifier"),
CompareOp.EQUAL, expectedComp2);
expectedFilter2.setFilterIfMissing(true);
FilterList expectedFilterList = new FilterList();
expectedFilterList.addFilter(expectedFilter1);
expectedFilterList.addFilter(expectedFilter2);
FilterList returnedFilterList = HBaseFilterFactory.getColumnFilters(report);
assertTrue(returnedFilterList.getFilters().size()==2);
SingleColumnValueFilter returnedFilter1 = (SingleColumnValueFilter) returnedFilterList.getFilters().get(0);
LongComparator returnedComparator1 = (LongComparator) returnedFilter1.getComparator();
assertTrue(Bytes.compareTo(expectedComp1.getValue(),
returnedComparator1.getValue()) == 0);
assertTrue(Bytes.compareTo(expectedFilter1.getFamily(),
returnedFilter1.getFamily()) == 0);
assertTrue(Bytes.compareTo(expectedFilter1.getQualifier(),
returnedFilter1.getQualifier()) == 0);
assertTrue(returnedFilter1.getFilterIfMissing());
assertEquals(expectedFilter1.getOperator(), returnedFilter1.getOperator());
assertEquals(expectedComp1.getLength(), returnedComparator1.getLength());
assertEquals(expectedComp1.getOffset(), returnedComparator1.getOffset());
SingleColumnValueFilter returnedFilter2 = (SingleColumnValueFilter) returnedFilterList.getFilters().get(1);
SubBinaryComparator returnedComparator2 = (SubBinaryComparator) returnedFilter2.getComparator();
assertTrue(Bytes.compareTo(expectedComp2.getValue(),
returnedComparator2.getValue()) == 0);