RowAliasFilter rowFilter = new RowAliasFilter();
rowFilter.setFilterType(type);
rowFilter.setValue("123");
rowFilter.setRowAlias(alias);
DoubleComparator expectedComp = new DoubleComparator(123, 0, 8);
RowFilter expectedFilter = new RowFilter(CompareOp.LESS, expectedComp);
Mapping mapping = new Mapping();
Map<String, RowAlias> rowAliases = new TreeMap<String, RowAlias>();
rowAliases.put(alias.getAlias(), alias);
mapping.setRowAlias(rowAliases);
RowFilter filterReturned = HBaseFilterFactory.getRowFilter(rowFilter,
mapping);
DoubleComparator returnedComparator = (DoubleComparator) filterReturned
.getComparator();
assertTrue(Bytes.compareTo(expectedComp.getValue(),
returnedComparator.getValue()) == 0);
assertEquals(expectedFilter.getOperator(), filterReturned.getOperator());
assertEquals(expectedComp.getLength(), returnedComparator.getLength());
assertEquals(expectedComp.getOffset(), returnedComparator.getOffset());
}