@SuppressWarnings({ "rawtypes", "unchecked" }) @Test public void testColumn() { ResultNode node = new ResultNode("testDim", "testDim"); node.setName("testDim"); node.setValue("testDim"); assertTrue("testDim".equals(node.getName())); assertTrue("testDim".equals(node.getValue())); List<String> dimensions = new ArrayList<String>(); Map<String, String> nameAliasMap = new HashMap<String, String>(); dimensions.add("testDim"); nameAliasMap.put("testDim", "dimension"); ColumnNameRevisor cr = new ColumnNameRevisor(dimensions, nameAliasMap); cr.revise(node); assertTrue("dimension".equals(node.getName())); ColumnValueCollector cc = new ColumnValueCollector("dimension"); List<String> valueList = new ArrayList<String>(); ColumnValueCollector cc2 = new ColumnValueCollector("dimension", valueList); assertTrue(valueList.equals(cc2.getValueCollection())); valueList.add("testDim"); cc.revise(node); cc2.revise(node); assertTrue(valueList.equals(cc2.getValueCollection())); }
@Override public void revise(ResultNode node) { if(dimensions!=null && dimensions.contains(node.getName())){ String newColumnName = replaceColumnToUserRequest(node.getName(), nameAliasMap); node.setName(newColumnName); } }
ColumnNameRevisor implements ResultRevisor { @Override public void revise(ResultNode node) { if(dimensions!=null && dimensions.contains(node.getName())){ String newColumnName = replaceColumnToUserRequest(node.getName(), nameAliasMap); node.setName(newColumnName); } } }
ColumnNameRevisor implements ResultRevisor { @Override public void revise(ResultNode node) { if(dimensions!=null && dimensions.contains(node.getName())){ String newColumnName = replaceColumnToUserRequest(node.getName(), nameAliasMap); node.setName(newColumnName); } } ColumnNameRevisor(List<String> dimensions,
			Map<String, String> nameAliasMap); }
ColumnNameRevisor implements ResultRevisor { @Override public void revise(ResultNode node) { if(dimensions!=null && dimensions.contains(node.getName())){ String newColumnName = replaceColumnToUserRequest(node.getName(), nameAliasMap); node.setName(newColumnName); } } ColumnNameRevisor(List<String> dimensions,
			Map<String, String> nameAliasMap); @Override void revise(ResultNode node); }
ColumnNameRevisor implements ResultRevisor { @Override public void revise(ResultNode node) { if(dimensions!=null && dimensions.contains(node.getName())){ String newColumnName = replaceColumnToUserRequest(node.getName(), nameAliasMap); node.setName(newColumnName); } } ColumnNameRevisor(List<String> dimensions,
			Map<String, String> nameAliasMap); @Override void revise(ResultNode node);  }