}
@Test
public void testScanCompositeRowWithSelectedColumnsSubstr() throws IOException,
CruxException {
Report report = new Report();
Mapping mapping = new Mapping();
mapping.setTableName(TABLE_2);
RowAlias rAlias1 = new RowAlias();
rAlias1.setAlias("rowkeyLong");
rAlias1.setLength(8);
rAlias1.setId(1l);
ValueType valueType1 = new ValueType();
valueType1.setClassName("java.lang.Long");
rAlias1.setValueType(valueType1);
rAlias1.setMapping(mapping);
//mapping.addRowAlias(rAlias1);
RowAlias rAlias2 = new RowAlias();
rAlias2.setAlias("rowkeyInt");
rAlias2.setLength(4);
rAlias2.setId(2l);
ValueType valueType2 = new ValueType();
valueType2.setClassName("java.lang.Integer");
rAlias2.setValueType(valueType2);
rAlias2.setMapping(mapping);
//mapping.addRowAlias(rAlias2);
RowAlias rAlias3 = new RowAlias();
rAlias3.setAlias("rowkeyString");
rAlias3.setId(3l);
rAlias3.setLength((int) Bytes.toBytes("I am a String" + 11).length);
ValueType valueType3 = new ValueType();
valueType3.setClassName("java.lang.String");
rAlias3.setValueType(valueType3);
rAlias3.setMapping(mapping);
//mapping.addRowAlias(rAlias3);
LinkedHashMap<String, RowAlias> rowAliases = new LinkedHashMap<String, RowAlias>();
rowAliases.put(rAlias1.getAlias(), rAlias1);
rowAliases.put(rAlias2.getAlias(), rAlias2);
rowAliases.put(rAlias3.getAlias(), rAlias3);
mapping.setRowAlias(rowAliases);
ColumnAlias cAlias = new ColumnAlias();
cAlias.setAlias("col");
cAlias.setColumnFamily("cf");
cAlias.setQualifier("qualifier");
cAlias.setValueType(valueType3);
mapping.addColumnAlias(cAlias);
ColumnAlias cAlias1 = new ColumnAlias();
cAlias1.setAlias("col1");
cAlias1.setColumnFamily("cf1");
cAlias.setQualifier("qualifier");
cAlias1.setValueType(valueType1);
mapping.addColumnAlias(cAlias1);
ColumnAlias cAlias2 = new ColumnAlias();
cAlias2.setAlias("col");
cAlias2.setColumnFamily("cf");
cAlias2.setQualifier("qualifier1");
cAlias2.setValueType(valueType3);
mapping.addColumnAlias(cAlias2);
FilterType filter = new FilterType();
filter.setType("Substring");
ColumnFilter columnFilter1 = new ColumnFilter();
columnFilter1.setFilterType(filter);
columnFilter1.setColumnAlias(cAlias2);
columnFilter1.setValue("sub2");
ArrayList<ColumnFilter> filters = new ArrayList<ColumnFilter>();
filters.add(columnFilter1);
report.setColumnFilters(filters);
ReportDesign design = new ReportDesign();
design.setColumnAlias(cAlias);
report.addDesign(design);
ReportDesign design1 = new ReportDesign();
design1.setColumnAlias(cAlias2);
report.addDesign(design1);
ReportDesign design3 = new ReportDesign();
design3.setRowAlias(rAlias1);
report.addDesign(design3);
ReportDesign design4 = new ReportDesign();
design4.setRowAlias(rAlias2);
report.addDesign(design4);
ReportDesign design5 = new ReportDesign();
design5.setRowAlias(rAlias3);
report.addDesign(design5);
HBaseFacade hbaseFacade = new HBaseFacade(pool);
CruxScanner scanner = hbaseFacade.execute(connection, report, mapping);
assertTrue(scanner instanceof CruxScannerResultScannerImpl);
CruxResult scanResult = null;