Examples of MvelEvaluatorCompiler


Examples of com.google.sitebricks.compiler.MvelEvaluatorCompiler

    }

    @Test
    public final void compileMethodMatchInDeeperObjectGraph() throws ExpressionCompileException {
        assert A_NAME.substring(1).equals(new MvelEvaluatorCompiler(AType.class)
                                            .compile("b.aString.substring(1)")
                                            .evaluate(null, new AType(A_NAME)));


    }
View Full Code Here

Examples of com.google.sitebricks.compiler.MvelEvaluatorCompiler

    }

    @Test
    public final void compileExpressionIntegerTypeMatchInDeeperObjectGraph() throws ExpressionCompileException {
        new MvelEvaluatorCompiler(AType.class)
                                    .compile("b.a.b.a.b.name / 44");

    }
View Full Code Here

Examples of com.google.sitebricks.compiler.MvelEvaluatorCompiler

    }

    @Test
    public final void compileExpressionNumericTypeMatchInDeeperObjectGraph() throws ExpressionCompileException {
        new MvelEvaluatorCompiler(AType.class)
                                    .compile("b.a.b.a.b.dubdub / new Double(44.0)");

    }
View Full Code Here

Examples of com.google.sitebricks.compiler.MvelEvaluatorCompiler

    }

//    @Test(expectedExceptions = ExpressionCompileException.class) DISABLED TEMPORARILY
    public final void failCompileExpressionNumericTypeMismatchInDeeperObjectGraph() throws ExpressionCompileException {
      // TODO(dhanji): MVEL bug
        new MvelEvaluatorCompiler(AType.class)
                                    .compile("b.a.b.a.b.name / new Double(44.0)");

    }
View Full Code Here

Examples of com.google.sitebricks.compiler.MvelEvaluatorCompiler

    }

    @Test(expectedExceptions = ExpressionCompileException.class)
    public final void failCompileDueToPathMismatchInDeeperObjectGraph() throws ExpressionCompileException {
        new MvelEvaluatorCompiler(AType.class)
                                    .compile("name.b.a.b.name + 2");

    }
View Full Code Here

Examples of com.google.sitebricks.compiler.MvelEvaluatorCompiler

    }

//    @Test(expectedExceptions = ExpressionCompileException.class) DISABLED TEMPORARILY
    public final void failCompileDueToTypeMismatchInDeeperObjectGraph() throws ExpressionCompileException {
      // TODO(dhanji): fix in mvel!!!!!
        new MvelEvaluatorCompiler(AType.class)
                                    .compile("b.a.name - 2");
    }
View Full Code Here

Examples of com.google.sitebricks.compiler.MvelEvaluatorCompiler

//    @Test   DISABLED TEMPORARILY
    public final void compileTypeMatchInDeeperObjectGraph() throws ExpressionCompileException {
        //should not throw exception

        // TODO(dhanji): Fix this in mvel, this is a problem with the egress type detection in IntSub
        final MvelEvaluatorCompiler evaluatorCompiler = new MvelEvaluatorCompiler(AType.class);
//        evaluatorCompiler.compile("b.name - 2");

        assert Integer.class.isAssignableFrom(Generics.erase(evaluatorCompiler.resolveEgressType("b.name - 2")));
    }
View Full Code Here

Examples of com.google.sitebricks.compiler.MvelEvaluatorCompiler

    }

//    @Test(expectedExceptions = ExpressionCompileException.class) DISABLED TEMPORARILY
    public final void failCompileDueToTypeMismatch() throws ExpressionCompileException {
  // TODO(dhanji) fix in mvel
        new MvelEvaluatorCompiler(AType.class)
                                    .compile("name - 2");
    }
View Full Code Here

Examples of com.google.sitebricks.compiler.MvelEvaluatorCompiler

                                    .compile("name - 2");
    }

    @Test
    public final void determineEgressTypeParameter() throws ExpressionCompileException {
        final Type egressType = new MvelEvaluatorCompiler(AType.class)
                .resolveEgressType("bs");
       
        assert BType.class.equals(Generics.erase(Generics.getTypeParameter(egressType, Collection.class.getTypeParameters()[0])));
    }
View Full Code Here

Examples of com.google.sitebricks.compiler.MvelEvaluatorCompiler

        assert BType.class.equals(Generics.erase(Generics.getTypeParameter(egressType, Collection.class.getTypeParameters()[0])));
    }

    @Test
    public final void determineEgressTypeParameterInExpressionChain() throws ExpressionCompileException {
        final Type egressType = new MvelEvaluatorCompiler(BType.class)
                .resolveEgressType("a.bs");
        assert BType.class.equals(Generics.erase(Generics.getTypeParameter(egressType, Collection.class.getTypeParameters()[0])));
    }
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.