public static char[] loadFromFile(File file) throws IOException { return loadFromFile(file, null); }
public static char[] loadFromFile(File file) throws IOException { return loadFromFile(file, null); }
public static char[] loadFromFile(File file) throws IOException { return loadFromFile(file, null); }
private static Object _evalFile(File file, String encoding, Object ctx, VariableResolverFactory factory) throws IOException { return eval(loadFromFile(file, encoding), ctx, factory); }
private static Object _evalFile(File file, String encoding, Object ctx, VariableResolverFactory factory) throws IOException { return eval(loadFromFile(file, encoding), ctx, factory); }
private static Object _evalFile(File file, String encoding, Object ctx, VariableResolverFactory factory) throws IOException { try { return eval(loadFromFile(file, encoding), ctx, factory); } catch (EndWithValue end) { return end.getValue(); } }
public void testMVEL238() throws IOException { String expr = new String(loadFromFile(new File("src/test/java/org/mvel2/tests/MVEL238.mvel"))); Serializable s = MVEL.compileExpression(expr); System.out.println(MVEL.executeExpression(s, new HashMap())); System.out.println(MVEL.executeExpression(s, new HashMap())); }
private static void testQuickSortMVEL(PrintStream ps) throws IOException { double time; time = System.currentTimeMillis(); char[] sourceFile = ParseTools.loadFromFile(new File("samples/scripts/quicksort.mvel")); Serializable c = MVEL.compileExpression(sourceFile); Map vars = new HashMap(); DecimalFormat dc = new DecimalFormat("#.##"); for (int a = 0; a < 10000; a++) { vars.clear(); MVEL.executeExpression(c, vars); } ps.println("Result: " + (time = System.currentTimeMillis() - time)); ps.println("Rate : " + (COUNT / (time / 1000)) + " per second."); ps.println("FreeMem: " + dc.format((double) getRuntime().freeMemory() / (1024d * 1024d)) + "MB / TotalMem: " + dc.format((double) getRuntime().totalMemory() / (1024d * 1024d)) + "MB"); ps.println("TotalGarbaged: " + DynamicOptimizer.totalRecycled); }
public void testQuickSortScript3() throws IOException { Object[] sorted = (Object[]) MVEL.eval(new String(loadFromFile(new File("samples/scripts/quicksort2.mvel"))), new HashMap()); int last = -1; for (Object o : sorted) { if (last == -1) { last = (Integer) o; } else { assertTrue(((Integer) o) > last); last = (Integer) o; } } }
public void testQuickSortScript4() throws IOException { Object[] sorted = (Object[]) MVEL.eval(new String(loadFromFile(new File("samples/scripts/quicksort3.mvel"))), new HashMap()); int last = -1; for (Object o : sorted) { if (last == -1) { last = (Integer) o; } else { assertTrue(((Integer) o) > last); last = (Integer) o; } } }
public void testQuickSortScript2() throws IOException { Object[] sorted = (Object[]) test(new String(loadFromFile(new File("samples/scripts/quicksort.mvel")))); int last = -1; for (Object o : sorted) { if (last == -1) { last = (Integer) o; } else { assertTrue(((Integer) o) > last); last = (Integer) o; } } }
public void testQuickSortScript5() throws IOException { List sorted = (List) executeExpression(compileExpression(loadFromFile(new File("samples/scripts/fquicksort.mvel"))), new HashMap()); int last = -1; for (Object o : sorted) { if (last == -1) { last = (Integer) o; } else { assertTrue(((Integer) o) > last); last = (Integer) o; } } }
public void testQuickSort() throws IOException { Serializable s = MVEL.compileExpression(new String(ParseTools.loadFromFile(new File("samples/scripts/fquicksort.mvel"))));