bindings = tree.bind(null, context.getVariableMapper());
assertTrue(getNode(tree).isReadOnly(bindings, context));
}
public void testSetValue() {
Tree tree = null;
Bindings bindings = null;
tree = parse("${bad}");
bindings = tree.bind(null, context.getVariableMapper());
getNode(tree).setValue(bindings, context, "good");
assertEquals("good", getNode(tree).getValue(bindings, context, null));
tree = parse("${var_long_1}");
bindings = tree.bind(null, context.getVariableMapper());
try { getNode(tree).setValue(bindings, context, 2l); fail(); } catch (ELException e) {}
tree = parse("${property_long_1}");
bindings = tree.bind(null, context.getVariableMapper());
assertEquals(1l, getNode(tree).getValue(bindings, context, null));
getNode(tree).setValue(bindings, context, 2l);
assertEquals(2l, getNode(tree).getValue(bindings, context, null));
tree = parse("${var_var_long_1}");
bindings = tree.bind(null, context.getVariableMapper());
try { getNode(tree).setValue(bindings, context, 2l); fail(); } catch (ELException e) {}
tree = parse("${var_property_long_1}");
bindings = tree.bind(null, context.getVariableMapper());
assertEquals(2l, getNode(tree).getValue(bindings, context, null));
getNode(tree).setValue(bindings, context, 1l);
assertEquals(1l, getNode(tree).getValue(bindings, context, null));
tree = parse("${indentifier_string}");
bindings = tree.bind(null, context.getVariableMapper());
try { getNode(tree).setValue(bindings, context, "bar"); fail(); } catch (ELException e) {}
}