use of org.mvel2.tests.core.res.WorkingMemoryImpl in project mvel by mikebrock.
the class CoreConfidenceTests method testsequentialAccessorsThenMethodCall.
public void testsequentialAccessorsThenMethodCall() {
String expr = "System.out.println(drools.workingMemory); " + "drools.workingMemory.ruleBase.removeRule(\"org.drools.examples\", \"some rule\"); ";
ExpressionCompiler compiler = new ExpressionCompiler(expr);
ParserContext context = new ParserContext();
context.setStrictTypeEnforcement(true);
context.addInput("drools", KnowledgeHelper.class);
RuleBase ruleBase = new RuleBaseImpl();
WorkingMemory wm = new WorkingMemoryImpl(ruleBase);
KnowledgeHelper drools = new DefaultKnowledgeHelper(wm);
Map vars = new HashMap();
vars.put("drools", drools);
executeExpression(compiler.compile(context), vars);
}
use of org.mvel2.tests.core.res.WorkingMemoryImpl in project mvel by mvel.
the class CoreConfidenceTests method testsequentialAccessorsThenMethodCall.
public void testsequentialAccessorsThenMethodCall() {
String expr = "System.out.println(drools.workingMemory); " + "drools.workingMemory.ruleBase.removeRule(\"org.drools.examples\", \"some rule\"); ";
ParserContext context = new ParserContext();
context.setStrictTypeEnforcement(true);
context.addInput("drools", KnowledgeHelper.class);
RuleBase ruleBase = new RuleBaseImpl();
WorkingMemory wm = new WorkingMemoryImpl(ruleBase);
KnowledgeHelper drools = new DefaultKnowledgeHelper(wm);
Map vars = new HashMap();
vars.put("drools", drools);
ExpressionCompiler compiler = new ExpressionCompiler(expr, context);
executeExpression(compiler.compile(), vars);
}
Aggregations