b.setSpecificOrderBy("schema1", new OrderBy().add("blabla", Order.DESC));
TupleMRConfig config = b.buildConf();
config.getSerializationInfo();
{
List<SortElement> expectedCommon = new ArrayList<SortElement>();
expectedCommon.add(new SortElement("b", Order.ASC, Criteria.NullOrder.NULL_SMALLEST));
expectedCommon.add(new SortElement("c", Order.DESC, Criteria.NullOrder.NULL_SMALLEST));
Assert.assertEquals(new Criteria(expectedCommon), config.getCommonCriteria());
}
{
List<SortElement> expectedSchema1 = new ArrayList<SortElement>();
expectedSchema1.add(new SortElement("a", Order.DESC, Criteria.NullOrder.NULL_SMALLEST));
expectedSchema1.add(new SortElement("blabla", Order.DESC, Criteria.NullOrder.NULL_SMALLEST));
Assert.assertEquals(new Criteria(expectedSchema1), config.getSpecificOrderBys()
.get(0));
}
{
List<SortElement> expectedSchema2 = new ArrayList<SortElement>();
expectedSchema2.add(new SortElement("a", Order.DESC, Criteria.NullOrder.NULL_SMALLEST));
Assert.assertEquals(new Criteria(expectedSchema2), config.getSpecificOrderBys()
.get(1));
}
}