@@ -0,0 +1,1973 @@
+/*%0A * Copyright 2002-2006 The Apache Software Foundation.%0A * %0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A * %0A *      http://www.apache.org/licenses/LICENSE-2.0%0A * %0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.apache.commons.jexl;%0A%0Aimport junit.framework.TestCase;%0A%0Apublic class BlockTest extends TestCase %7B%0A%0A    /**%0A     * Create the test%0A     * %0A     * @param testName name of the test%0A     */%0A    public BlockTest(String testName) %7B%0A        super(testName);%0A    %7D%0A%0A    public void testBlockSimple() throws Exception %7B%0A        Expression e = ExpressionFactory%0A                .createExpression(%22if (true) %7B 'hello'; %7D%22);%0A        JexlContext jc = JexlHelper.createContext();%0A        Object o = e.evaluate(jc);%0A        assertEquals(%22Result is wrong%22, %22hello%22, o);%0A    %7D%0A    %0A    public void testBlockExecutesAll() throws Exception %7B%0A        Expression e = ExpressionFactory%0A                .createExpression(%22if (true) %7B x = 'Hello'; y = 'World';%7D%22);%0A        JexlContext jc = JexlHelper.createContext();%0A        Object o = e.evaluate(jc);%0A        assertEquals(%22First result is wrong%22, %22Hello%22, jc.getVars().get(%22x%22));%0A        assertEquals(%22Second result is wrong%22, %22World%22, jc.getVars().get(%22y%22));%0A        assertEquals(%22Block result is wrong%22, %22World%22, o);%0A    %7D%0A%0A    public void testEmptyBlock() throws Exception %7B%0A        Expression e = ExpressionFactory%0A                .createExpression(%22if (true) %7B %7D%22);%0A        JexlContext jc = JexlHelper.createContext();%0A        Object o = e.evaluate(jc);%0A        assertNull(%22Result is wrong%22, o);%0A    %7D%0A%7D%0A

Add tests for ASTBlock