@Test
public void testPopulatePropertyExpressionsFromGraph() {

    Map<String, String> expressionGraph = new HashMap<String, String>();
    expressionGraph.put("property1", "@{expr1}");
    expressionGraph.put("property2", "@{expr2}");
    expressionGraph.put("property3['key1']", "@{key1expr}");
    expressionGraph.put("property4.property1", "@{nexpr1}");
    expressionGraph.put("property4.property4.property3['key2']", "@{nkey2expr}");
    MockConfigurable configurable = new MockConfigurable();
    MockConfigurable configurable2 = new MockConfigurable();
    MockConfigurable configurable3 = new MockConfigurable();
    configurable2.setProperty4(configurable3);
    configurable.setProperty4(configurable2);
    configurable.setExpressionGraph(expressionGraph);
    ViewLifecycle.getExpressionEvaluator().populatePropertyExpressionsFromGraph(configurable, false);
    assertEquals("Expression count not correct in root configurable", 3,
            configurable.getPropertyExpressions().size());
    assertEquals("Expression not correct for property1", "@{expr1}", configurable.getPropertyExpression(
            "property1"));
    assertEquals("Expression not correct for property2", "@{expr2}", configurable.getPropertyExpression(
            "property2"));
    assertEquals("Expression not correct for map property3", "@{key1expr}", configurable.getPropertyExpression(
            "property3['key1']"));
    assertEquals("Expression count not correct in nested configurable", 1,
            configurable.getProperty4().getPropertyExpressions().size());
    assertEquals("Expression not correct for nested property1", "@{nexpr1}",
            configurable.getProperty4().getPropertyExpression("property1"));
    assertEquals("Expression count not correct in two level nested configurable", 1,
            configurable.getProperty4().getProperty4().getPropertyExpressions().size());
    assertEquals("Expression not correct for nested map property3", "@{nkey2expr}",
            configurable.getProperty4().getProperty4().getPropertyExpression("property3['key2']"));
}