Package org.codehaus.preon.el.ast

Examples of org.codehaus.preon.el.ast.RelationalNode.eval()


    @Test
    public void testJustRelation() {
        Node<Integer,?> a = new IntegerNode(12);
        Node<Integer,?> b = new IntegerNode(13);
        Node<Boolean,?> expr = new RelationalNode(Relation.GT, a, b);
        assertEquals(false, expr.eval(null).booleanValue());
    }

    @SuppressWarnings("unchecked")
    @Test
    public void testCompound() {
View Full Code Here


        Node<Integer,?> c = new IntegerNode(14);
        Node<Integer,?> d = new IntegerNode(15);
        Node<Integer,?> expr1 = new ArithmeticNode(Operator.plus, a, b);
        Node<Integer,?> expr2 = new ArithmeticNode(Operator.minus, c, d);
        Node<Boolean,?> expr = new RelationalNode(Relation.GT, expr1, expr2);
        assertEquals(true, expr.eval(null).booleanValue());
    }

}
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.