Package de.odysseus.el.tree

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


    tree = parse("${g1(42)}");
    assertEquals(bar(42), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = parse("${g2(21,21)}");
    assertEquals(foobar(21,21), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));
  }

  public void testAppendStructure() {
    StringBuilder s = null;
View Full Code Here


  public void testGetValue() {
    Tree tree = null;

    tree = parse("${ns:f0()}");

    assertEquals(foo(), getNode(tree).getValue(tree.bind(context.getFunctionMapper(), null), null, null));
    assertEquals("" + foo(), getNode(tree).getValue(tree.bind(context.getFunctionMapper(), null), null, String.class));
  }
}
View Full Code Here

    Tree tree = null;

    tree = parse("${ns:f0()}");

    assertEquals(foo(), getNode(tree).getValue(tree.bind(context.getFunctionMapper(), null), null, null));
    assertEquals("" + foo(), getNode(tree).getValue(tree.bind(context.getFunctionMapper(), null), null, String.class));
  }
}
View Full Code Here

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

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

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

    tree = parse("${property_long_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertEquals(1l, getNode(tree).eval(bindings, context));
View Full Code Here

    tree = parse("${var_long_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertEquals(1l, getNode(tree).eval(bindings, context));

    tree = parse("${property_long_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertEquals(1l, getNode(tree).eval(bindings, context));

    tree = parse("${indentifier_string}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertEquals("foo", getNode(tree).eval(bindings, context));
View Full Code Here

    tree = parse("${property_long_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertEquals(1l, getNode(tree).eval(bindings, context));

    tree = parse("${indentifier_string}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertEquals("foo", getNode(tree).eval(bindings, context));

    tree = parse("${var_var_long_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertEquals(1l, getNode(tree).eval(bindings, context));
View Full Code Here

    tree = parse("${indentifier_string}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertEquals("foo", getNode(tree).eval(bindings, context));

    tree = parse("${var_var_long_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertEquals(1l, getNode(tree).eval(bindings, context));

    tree = parse("${var_property_long_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertEquals(1l, getNode(tree).eval(bindings, context));
View Full Code Here

    tree = parse("${var_var_long_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertEquals(1l, getNode(tree).eval(bindings, context));

    tree = parse("${var_property_long_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertEquals(1l, getNode(tree).eval(bindings, context));
  }

  public void testAppendStructure() {
    StringBuilder s = new StringBuilder();
View Full Code Here

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

    tree = parse("${var_long_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertEquals(null, getNode(tree).getType(bindings, context));

    tree = parse("${property_long_1}");
    bindings = tree.bind(null, context.getVariableMapper());
    assertEquals(Object.class, getNode(tree).getType(bindings, context));
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.