Search in sources :

Example 1 with ExecutableAccessor

use of org.mvel2.compiler.ExecutableAccessor in project mvel by mikebrock.

the class InlineCollectionsPerformance method testMVELList.

//    public static void testMVELList() {
//
//        ExecutableAccessor s = (ExecutableAccessor) MVEL.compileExpression("['Foo244':'Bar','Foo244':'Bar','Foo244':'Bar','Foo244':'Bar','Foo244':'Bar']");
//        Map list;
//        s.getNode().getReducedValueAccelerated(null, null, null);
//        for (int i = 0; i < COUNT; i++) {
//            list = (Map) s.getNode().getAccessor().getValue(null, null, null);
//
//        }
//    }
//    public static void testMVELList() {
//
//        ExecutableAccessor s = (ExecutableAccessor) MVEL.compileExpression("{'Foo244','Bar','Foo244','Bar','Foo244','Bar','Foo244','Bar','Foo244','Bar'}");
//        Object[] list;
//        s.getNode().getReducedValueAccelerated(null, null, null);
//        for (int i = 0; i < COUNT; i++) {
//            list = (Object[]) s.getNode().getAccessor().getValue(null, null, null);
//
//            //     assert "Foo244".equals(list.get(0)) && "Foo244".equals(list.get(2)) && list.size() == 10;
//        }
//    }
public static void testMVELList() {
    ExecutableAccessor s = (ExecutableAccessor) MVEL.compileExpression("['Foo244','Bar','Foo244','Bar','Foo244','Bar','Foo244','Bar','Foo244','Bar']");
    List list;
    s.getNode().getReducedValueAccelerated(null, null, null);
    for (int i = 0; i < COUNT; i++) {
        list = (List) s.getNode().getAccessor().getValue(null, null, null);
        assert "Foo244".equals(list.get(0)) && "Foo244".equals(list.get(2)) && list.size() == 10;
    }
}
Also used : ExecutableAccessor(org.mvel2.compiler.ExecutableAccessor) List(java.util.List) FastList(org.mvel2.util.FastList)

Aggregations

List (java.util.List)1 ExecutableAccessor (org.mvel2.compiler.ExecutableAccessor)1 FastList (org.mvel2.util.FastList)1