@@ -0,0 +1,2075 @@
+/*%0A * Copyright 2016 Ali Moghnieh%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 */%0A%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport com.blurengine.blur.modules.filters.Filter;%0Aimport com.blurengine.blur.modules.filters.Filter.FilterResponse;%0Aimport com.blurengine.blur.modules.filters.lexer.FilterRecursiveDescentParser;%0A%0Aimport org.junit.Test;%0A%0A/**%0A * Tests the filter lexer.%0A */%0Apublic class FilterLexerTest %7B%0A%0A    public static final String TRUE = %22true%22;%0A    public static final String TRUE_OR_FALSE = %22true%7Cfalse%22;%0A    public static final String TRUE_OR_FALSE_WHITESPACE = %22true %7C false%22;%0A    public static final String COMPLEX_EXPRESSION_RETURN_FALSE = %22((false & true) & true) & (true & false) %7C ((false) %7C false)%22;%0A%0A    @Test%0A    public void testTrue() throws Exception %7B%0A        Filter filter = parse(TRUE);%0A        assertTrue(filter.test(null) == FilterResponse.ALLOW);%0A    %7D%0A%0A    @Test%0A    public void testTrueOrFalse() throws Exception %7B%0A        Filter filter = parse(TRUE_OR_FALSE);%0A        assertTrue(filter.test(null) == FilterResponse.ALLOW);%0A%0A        filter = parse(TRUE_OR_FALSE_WHITESPACE);%0A        assertTrue(filter.test(null) == FilterResponse.ALLOW);%0A    %7D%0A%0A    @Test%0A    public void testComplex() throws Exception %7B%0A        Filter filter = parse(COMPLEX_EXPRESSION_RETURN_FALSE);%0A        assertTrue(filter.test(null) == FilterResponse.DENY);%0A    %7D%0A%0A    public Filter parse(String str) %7B%0A        return new FilterRecursiveDescentParser(a -%3E null, str).call(); // FIXME First param is a null supplier for filter references by id.%0A    %7D%0A%7D%0A

Create FilterLexerTest.