use of org.mvel2.tests.core.res.Cheesery in project mvel by mikebrock.
the class CoreConfidenceTests method testDynamicImportsOnNestedExpressions.
public void testDynamicImportsOnNestedExpressions() {
ParserContext ctx = new ParserContext();
ctx.addPackageImport("org.mvel2.tests.core.res");
ExpressionCompiler compiler = new ExpressionCompiler("new Cheesery(\"bobbo\", new Cheese(\"cheddar\", 15))");
Cheesery p1 = new Cheesery("bobbo", new Cheese("cheddar", 15));
Cheesery p2 = (Cheesery) executeExpression(compiler.compile(ctx), new DefaultLocalVariableResolverFactory());
assertEquals(p1, p2);
}
use of org.mvel2.tests.core.res.Cheesery in project mvel by mvel.
the class CoreConfidenceTests method testDynamicImportsWithNullConstructorParamWithStrongType.
public void testDynamicImportsWithNullConstructorParamWithStrongType() {
ParserContext ctx = new ParserContext();
ctx.setStrongTyping(true);
ctx.addPackageImport("org.mvel2.tests.core.res");
ExpressionCompiler compiler = new ExpressionCompiler("new Cheesery(\"bobbo\", null)", ctx);
Cheesery p1 = new Cheesery("bobbo", null);
Cheesery p2 = (Cheesery) executeExpression(compiler.compile(), new DefaultLocalVariableResolverFactory());
assertEquals(p1, p2);
}
use of org.mvel2.tests.core.res.Cheesery in project mvel by mvel.
the class CoreConfidenceTests method testDynamicImportsWithNullConstructorParam.
public void testDynamicImportsWithNullConstructorParam() {
ParserContext ctx = new ParserContext();
ctx.addPackageImport("org.mvel2.tests.core.res");
ExpressionCompiler compiler = new ExpressionCompiler("new Cheesery(\"bobbo\", null)", ctx);
Cheesery p1 = new Cheesery("bobbo", null);
Cheesery p2 = (Cheesery) executeExpression(compiler.compile(), new DefaultLocalVariableResolverFactory());
assertEquals(p1, p2);
}
use of org.mvel2.tests.core.res.Cheesery in project mvel by mikebrock.
the class CoreConfidenceTests method testDynamicImportsWithNullConstructorParam.
public void testDynamicImportsWithNullConstructorParam() {
ParserContext ctx = new ParserContext();
ctx.addPackageImport("org.mvel2.tests.core.res");
ExpressionCompiler compiler = new ExpressionCompiler("new Cheesery(\"bobbo\", null)");
Cheesery p1 = new Cheesery("bobbo", null);
Cheesery p2 = (Cheesery) executeExpression(compiler.compile(ctx), new DefaultLocalVariableResolverFactory());
assertEquals(p1, p2);
}
use of org.mvel2.tests.core.res.Cheesery in project mvel by mvel.
the class CoreConfidenceTests method testDynamicImportsOnNestedExpressions.
public void testDynamicImportsOnNestedExpressions() {
ParserContext ctx = new ParserContext();
ctx.addPackageImport("org.mvel2.tests.core.res");
ExpressionCompiler compiler = new ExpressionCompiler("new Cheesery(\"bobbo\", new Cheese(\"cheddar\", 15))", ctx);
Cheesery p1 = new Cheesery("bobbo", new Cheese("cheddar", 15));
Cheesery p2 = (Cheesery) executeExpression(compiler.compile(), new DefaultLocalVariableResolverFactory());
assertEquals(p1, p2);
}
Aggregations