use of org.apache.commons.jexl2.parser.ASTJexlScript in project datawave by NationalSecurityAgency.
the class QueryPruningVisitorTest method orFalseTest.
@Test
public void orFalseTest() throws ParseException {
String query = "false || _NOFIELD_ == 'z'";
ASTJexlScript script = JexlASTHelper.parseJexlQuery(query);
Assert.assertEquals(QueryPruningVisitor.TruthState.FALSE, QueryPruningVisitor.getState(script));
Assert.assertEquals(0, logAppender.getMessages().size(), logAppender.getMessages().size());
}
use of org.apache.commons.jexl2.parser.ASTJexlScript in project datawave by NationalSecurityAgency.
the class QueryPruningVisitorTest method RENoFieldTest.
@Test
public void RENoFieldTest() throws ParseException {
String query = "_NOFIELD_ =~ 'x'";
ASTJexlScript script = JexlASTHelper.parseJexlQuery(query);
Assert.assertEquals(QueryPruningVisitor.TruthState.FALSE, QueryPruningVisitor.getState(script));
Assert.assertEquals(0, logAppender.getMessages().size(), logAppender.getMessages().size());
}
use of org.apache.commons.jexl2.parser.ASTJexlScript in project datawave by NationalSecurityAgency.
the class QueryPruningVisitorTest method markerBoundedRangeTest.
@Test
public void markerBoundedRangeTest() throws ParseException {
String query = "((Assignment = true) && (FIELD > 'x' && FIELD < 'z'))";
ASTJexlScript script = JexlASTHelper.parseJexlQuery(query);
Assert.assertEquals(QueryPruningVisitor.TruthState.UNKNOWN, QueryPruningVisitor.getState(script));
Assert.assertEquals(query, JexlStringBuildingVisitor.buildQuery(QueryPruningVisitor.reduce(script, false)));
}
use of org.apache.commons.jexl2.parser.ASTJexlScript in project datawave by NationalSecurityAgency.
the class QueryPruningVisitorTest method notTrueTest.
@Test
public void notTrueTest() throws ParseException {
String query = "!true";
ASTJexlScript script = JexlASTHelper.parseJexlQuery(query);
Assert.assertEquals(QueryPruningVisitor.TruthState.FALSE, QueryPruningVisitor.getState(script));
Assert.assertEquals(0, logAppender.getMessages().size(), logAppender.getMessages().size());
}
use of org.apache.commons.jexl2.parser.ASTJexlScript in project datawave by NationalSecurityAgency.
the class QueryPruningVisitorTest method GETest.
@Test
public void GETest() throws ParseException {
String query = "FIELD >= 'x'";
ASTJexlScript script = JexlASTHelper.parseJexlQuery(query);
Assert.assertEquals(QueryPruningVisitor.TruthState.UNKNOWN, QueryPruningVisitor.getState(script));
Assert.assertEquals(0, logAppender.getMessages().size(), logAppender.getMessages().size());
}
Aggregations