Search in sources :

Example 81 with ASTJexlScript

use of org.apache.commons.jexl3.parser.ASTJexlScript in project datawave by NationalSecurityAgency.

the class ValidComparisonVisitorTest method testMulNode.

@Test
public void testMulNode() throws ParseException {
    String queryString = "1*3*1 == 3";
    ASTJexlScript script = JexlASTHelper.parseJexlQuery(queryString);
    ValidComparisonVisitor.check(script);
}
Also used : ASTJexlScript(org.apache.commons.jexl2.parser.ASTJexlScript) Test(org.junit.Test)

Example 82 with ASTJexlScript

use of org.apache.commons.jexl3.parser.ASTJexlScript in project datawave by NationalSecurityAgency.

the class ValidComparisonVisitorTest method testInvalidNR.

@Test(expected = DatawaveFatalQueryException.class)
public void testInvalidNR() throws ParseException {
    String queryString = "'BAR' !~ 'foo'";
    ASTJexlScript script = JexlASTHelper.parseJexlQuery(queryString);
    ValidComparisonVisitor.check(script);
}
Also used : ASTJexlScript(org.apache.commons.jexl2.parser.ASTJexlScript) Test(org.junit.Test)

Example 83 with ASTJexlScript

use of org.apache.commons.jexl3.parser.ASTJexlScript in project datawave by NationalSecurityAgency.

the class ValidComparisonVisitorTest method testInvalidEQ.

@Test(expected = DatawaveFatalQueryException.class)
public void testInvalidEQ() throws ParseException {
    String queryString = "'BAR' == 1";
    ASTJexlScript script = JexlASTHelper.parseJexlQuery(queryString);
    ValidComparisonVisitor.check(script);
}
Also used : ASTJexlScript(org.apache.commons.jexl2.parser.ASTJexlScript) Test(org.junit.Test)

Example 84 with ASTJexlScript

use of org.apache.commons.jexl3.parser.ASTJexlScript in project datawave by NationalSecurityAgency.

the class ValidComparisonVisitorTest method testInvalidLT.

@Test(expected = DatawaveFatalQueryException.class)
public void testInvalidLT() throws ParseException {
    String queryString = "'BAR' < 1";
    ASTJexlScript script = JexlASTHelper.parseJexlQuery(queryString);
    ValidComparisonVisitor.check(script);
}
Also used : ASTJexlScript(org.apache.commons.jexl2.parser.ASTJexlScript) Test(org.junit.Test)

Example 85 with ASTJexlScript

use of org.apache.commons.jexl3.parser.ASTJexlScript in project datawave by NationalSecurityAgency.

the class ValidComparisonVisitorTest method testSubNode.

@Test
public void testSubNode() throws ParseException {
    String queryString = "5-1-1 == 3";
    ASTJexlScript script = JexlASTHelper.parseJexlQuery(queryString);
    ValidComparisonVisitor.check(script);
}
Also used : ASTJexlScript(org.apache.commons.jexl2.parser.ASTJexlScript) Test(org.junit.Test)

Aggregations

ASTJexlScript (org.apache.commons.jexl2.parser.ASTJexlScript)457 Test (org.junit.Test)385 Key (org.apache.accumulo.core.data.Key)69 JexlNode (org.apache.commons.jexl2.parser.JexlNode)61 HashSet (java.util.HashSet)50 ShardQueryConfiguration (datawave.query.config.ShardQueryConfiguration)48 MockMetadataHelper (datawave.query.util.MockMetadataHelper)40 Type (datawave.data.type.Type)38 LcNoDiacriticsType (datawave.data.type.LcNoDiacriticsType)37 ArrayList (java.util.ArrayList)37 ExpressionFilter (datawave.query.jexl.visitors.EventDataQueryExpressionVisitor.ExpressionFilter)36 ScannerFactory (datawave.query.tables.ScannerFactory)35 Date (java.util.Date)35 NoOpType (datawave.data.type.NoOpType)34 NumberType (datawave.data.type.NumberType)34 AbstractMap (java.util.AbstractMap)32 Range (org.apache.accumulo.core.data.Range)30 Value (org.apache.accumulo.core.data.Value)29 RangeFactoryForTests.makeTestRange (datawave.common.test.utils.query.RangeFactoryForTests.makeTestRange)26 QueryPlan (datawave.query.planner.QueryPlan)26