use of com.cinchapi.ccl.grammar.PostfixNotationSymbol in project concourse by cinchapi.
the class ConcourseCompilerTest method testToPostfixNotationSimple.
@Test
public void testToPostfixNotationSimple() {
Criteria criteria = Criteria.where().key("foo").operator(Operator.EQUALS).value("bar").build();
Queue<PostfixNotationSymbol> pfn = Parsing.toPostfixNotation(criteria.symbols());
Assert.assertEquals(pfn.size(), 1);
Assert.assertEquals(((ExpressionSymbol) Iterables.getOnlyElement(pfn)).key(), new KeySymbol("foo"));
Assert.assertEquals(((ExpressionSymbol) Iterables.getOnlyElement(pfn)).values().get(0), new ValueSymbol("bar"));
Assert.assertEquals(((ExpressionSymbol) Iterables.getOnlyElement(pfn)).operator(), new OperatorSymbol(Operator.EQUALS));
}
use of com.cinchapi.ccl.grammar.PostfixNotationSymbol in project concourse by cinchapi.
the class ConcourseCompilerTest method testParseCclTimestampComplexPhrase.
@Test
public void testParseCclTimestampComplexPhrase() {
String ccl = "name = jeff at \"last christmas\"";
Queue<PostfixNotationSymbol> symbols = ConcourseCompiler.get().arrange((ConditionTree) ConcourseCompiler.get().parse(ccl));
ExpressionSymbol expr = (ExpressionSymbol) symbols.poll();
// this means a
Assert.assertNotEquals(0, expr.raw().timestamp());
// timestamp was
// parsed
}
Aggregations