Package org.mvel2.tests.core.res

Examples of org.mvel2.tests.core.res.Bar


        return "NULL";
      }
    });

    Foo foo = new Foo();
    Bar bar = foo.getBar();
    foo.setBar(null);

    Map map = new HashMap();
    map.put("foo", foo);
View Full Code Here


        return "NULL";
      }
    });

    Foo foo = new Foo();
    Bar bar = foo.getBar();
    foo.setBar(null);

    Map map = new HashMap();
    map.put("foo", foo);
View Full Code Here

  protected Foo foo = new Foo();
  protected Map<String, Object> map = new HashMap<String, Object>();
  protected Base base = new Base();

  public CompiledPerformanceTests() {
    foo.setBar(new Bar());
    map.put("foo", foo);
    map.put("a", null);
    map.put("b", null);
    map.put("c", "cat");
    map.put("BWAH", "");
View Full Code Here

    assertEquals("Bobba",
        user.getFirstName());
  }

  public void testSetSemantics() {
    Bar bar = new Bar();
    Foo foo = new Foo();

    assertEquals("dog",
        MVEL.getProperty("name",
            bar));
View Full Code Here

        executeExpression(compiled,
            map)); // execute a second time (to search for optimizer problems)

    OptimizerFactory.setDefaultOptimizer("ASM");
    compiled = compileExpression(expression);
    foo.setBar(new Bar());
    assertEquals(false,
        executeExpression(compiled,
            map));
    foo.setBar(null);
    assertEquals(true,
View Full Code Here

    ParserConfiguration pconf = new ParserConfiguration();
    ParserContext pctx = new ParserContext(pconf);
    pctx.setStrongTyping(true);
    pctx.addInput("this", Bar.class);
    ExecutableStatement stmt = (ExecutableStatement) MVEL.compileExpression(str, pctx);
    Bar ctx = new Bar();
    ctx.setName("bob");
    Boolean result = (Boolean) MVEL.executeExpression(stmt, ctx);
    assertTrue(result);
  }
View Full Code Here

    ParserContext pctx = new ParserContext(pconf);
    pctx.setStrongTyping(true);
    pctx.addInput("this", Bar.class);
    pctx.addImport(Foo.class);
    ExecutableStatement stmt = (ExecutableStatement) MVEL.compileExpression(str, pctx);
    Bar ctx = new Bar();
    Boolean result = (Boolean) MVEL.executeExpression(stmt, ctx, new HashMap());
    assertTrue(result);
  }
View Full Code Here

    pctx.addImport(Foo.class);
    List<String> errors = new ArrayList<String>();
    for (String s : str) {
      try {
        ExecutableStatement stmt = (ExecutableStatement) MVEL.compileExpression(s, pctx);
        Bar ctx = new Bar();
        Boolean result = (Boolean) MVEL.executeExpression(stmt, ctx, new HashMap());
        assertTrue(result);
      }
      catch (Exception e) {
        e.printStackTrace();
View Full Code Here

    list.add("John");
    list.add("Foo");

    map.put("arrayList", list);

    foo.setBar(new Bar());
    map.put("foo", foo);
    map.put("a", null);
    map.put("b", null);
    map.put("c", "cat");
    map.put("BWAH", "");
View Full Code Here

        String[] allVars = new String[varNames.length + locals.length];

        System.arraycopy(varNames, 0, allVars, 0, varNames.length);
        System.arraycopy(locals, 0, allVars, varNames.length, locals.length);       
       
        this.varModel = new SimpleVariableSpaceModel(allVars);
        this.allVarsLength = allVars.length;
       
        return stmt;
    }
View Full Code Here

TOP

Related Classes of org.mvel2.tests.core.res.Bar

Copyright © 2018 www.massapicom. 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.