ValueType valueType = new ValueType(101, datastore, "valueType", "className1",
"className1", true);
Mapping mapping = new Mapping();
RowAlias rowAlias1 = new RowAlias(901, mapping, valueType, 4 ,"rowAliasName1");
RowAlias rowAlias2 = new RowAlias(902, mapping, valueType, 4 ,"rowAliasName2");
RowAlias rowAlias3 = new RowAlias(903, mapping, valueType, 4 ,"rowAliasName3");
Map<String, RowAlias> rowAliasMap = new TreeMap<String, RowAlias>();
rowAliasMap.put("rowAlias1", rowAlias1);
rowAliasMap.put("rowAlias2", rowAlias2);
rowAliasMap.put("rowAlias3", rowAlias3);
mapping.setRowAlias(rowAliasMap);
ArrayList<Mapping> mappingList = new ArrayList<Mapping>();
mappingList.add(mapping);
MappingAction mappingAction = new MappingAction();
// populateRowAliasViewList() returns void.
mappingAction.populateRowAliasViewList(mapping);
// Test aliases
assertEquals(mappingAction.getRowAliasViewList().get(0).getAlias(), rowAlias1.getAlias());
assertEquals(mappingAction.getRowAliasViewList().get(1).getAlias(), rowAlias2.getAlias());
assertEquals(mappingAction.getRowAliasViewList().get(2).getAlias(), rowAlias3.getAlias());
// Test each column type name
assertEquals(mappingAction.getRowAliasViewList().get(0).getColumnTypeName(), rowAlias1.getValueType().getName());
assertEquals(mappingAction.getRowAliasViewList().get(1).getColumnTypeName(), rowAlias2.getValueType().getName());
assertEquals(mappingAction.getRowAliasViewList().get(2).getColumnTypeName(), rowAlias3.getValueType().getName());
// test each id
assertEquals(mappingAction.getRowAliasViewList().get(0).getId(), rowAlias1.getId());
assertEquals(mappingAction.getRowAliasViewList().get(1).getId(), rowAlias2.getId());
assertEquals(mappingAction.getRowAliasViewList().get(2).getId(), rowAlias3.getId());
// test lenght of each rowAlias
assertEquals(mappingAction.getRowAliasViewList().get(0).getLength(), rowAlias1.getLength());
assertEquals(mappingAction.getRowAliasViewList().get(1).getLength(), rowAlias2.getLength());
assertEquals(mappingAction.getRowAliasViewList().get(2).getLength(), rowAlias3.getLength());
}