assertTrue(!exec.isGetOperation(report, mapping));
}
@Test
public void testGetRowForRowFilterinDifferentOrder() throws CruxException {
Report report = new Report();
Mapping mapping = new Mapping();
ValueType longType = new ValueType(1l, new Datastore(), "Long",
"java.lang.Long", true);
ValueType stringType = new ValueType(1l, new Datastore(), "String",
"java.lang.String", false);
RowAlias rAliasLong = new RowAlias();
rAliasLong.setAlias("rowkey");
rAliasLong.setId(1);
rAliasLong.setLength(8);
rAliasLong.setMapping(mapping);
rAliasLong.setValueType(longType);
RowAlias rAliasString = new RowAlias();
rAliasString.setAlias("rowkey");
rAliasString.setId(2);
rAliasString.setLength(4);
rAliasString.setMapping(mapping);
rAliasString.setValueType(stringType);
mapping.addRowAlias(rAliasLong);
mapping.addRowAlias(rAliasString);
FilterType filter1 = new FilterType();
filter1.setType("Equals");
RowAliasFilter rowFilter1 = new RowAliasFilter();
rowFilter1.setId(1);
rowFilter1.setFilterType(filter1);
rowFilter1.setRowAlias(rAliasString);
rowFilter1.setValue("String");
RowAliasFilter rowFilter2 = new RowAliasFilter();
rowFilter2.setId(2);
rowFilter2.setFilterType(filter1);
rowFilter2.setRowAlias(rAliasLong);
rowFilter2.setValue("123");
ArrayList<RowAliasFilter> filters = new ArrayList<RowAliasFilter>();
filters.add(rowFilter1);
filters.add(rowFilter2);
report.setRowAliasFilters(filters);
byte[] row = QueryExecutor.getGetRow(report, mapping);
byte[] expected = Bytes.add(Bytes.toBytes(123l),
Bytes.toBytes("String"));
assertTrue(Bytes.equals(expected, row));