Package de.odysseus.el.tree

Examples of de.odysseus.el.tree.Tree.bind()


    tree = parse("${var_property_long_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertFalse(getNode(tree).isReadOnly(bindings, context));

    tree = parse("${indentifier_string}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertTrue(getNode(tree).isReadOnly(bindings, context));
  }

  public void testSetValue() {
    Tree tree = null;
View Full Code Here


  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());
View Full Code Here

    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));
View Full Code Here

    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}");
View Full Code Here

    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));
View Full Code Here

    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}");
View Full Code Here

    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) {}
  }

  public void testGetValue() {
    Tree tree = null;
View Full Code Here

  public void testGetValue() {
    Tree tree = null;
    Bindings bindings = null;

    tree = parse("${bad}");
    bindings = tree.bind(null, context.getVariableMapper());
    try { getNode(tree).getValue(bindings, context, null); fail(); } catch (ELException e) {}
   
    tree = parse("${var_long_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertEquals(1l, getNode(tree).getValue(bindings, context, null));
View Full Code Here

    tree = parse("${bad}");
    bindings = tree.bind(null, context.getVariableMapper());
    try { getNode(tree).getValue(bindings, context, null); fail(); } catch (ELException e) {}
   
    tree = parse("${var_long_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertEquals(1l, getNode(tree).getValue(bindings, context, null));
    assertEquals("1", getNode(tree).getValue(bindings, context, String.class));
  }
 
  public void testInvoke() {
View Full Code Here

  public void testInvoke() {
    Tree tree = null;
    Bindings bindings = null;

    tree = parse("${bad}");
    bindings = tree.bind(null, context.getVariableMapper());
    try { getNode(tree).invoke(bindings, context, long.class, new Class[0], null); fail(); } catch (ELException e) {}
   
    tree = parse("${var_method_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertEquals(1l, getNode(tree).invoke(bindings, context, long.class, new Class[0], null));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.