Package com.googlecode.gql4j.GqlQuery

Examples of com.googlecode.gql4j.GqlQuery.FunctionEvaluator


    assertEquals(NullEvaluator.get(), parser("Null").value().r);
    assertEquals(new StringEvaluator("'abc'"), parser("'abc'").value().r);
    assertEquals(new BooleanEvaluator("true"), parser("true").value().r);
    assertEquals(new ParamEvaluator("abc"), parser(":abc").value().r);
    assertEquals(
        new FunctionEvaluator("key",
            ImmutableList.<Evaluator>of(new StringEvaluator("'abc'"))),
        parser("key('abc')").value().r);
   
    assertEquals(new DecimalEvaluator("1"), parser("1").value().r);
  }
View Full Code Here


  }
 
  @Test
  public void testCondition_2() throws RecognitionException {
    Condition expected = new Condition("d", FilterOperator.EQUAL,
        new FunctionEvaluator("datetime", new StringEvaluator("'2000-2-2 3:4:5'")));   

    Condition actual = parser("d = datetime('2000-2-2 3:4:5') ").condition().r;
   
    assertEquals(expected, actual);
  }
View Full Code Here

  @Test
  public void testParseWhere_6() {
    ParseResult actual = GqlQuery.parse("SELECT * from a WHERE ANCESTOR IS KEY('Person', 'Amy')");
    ParseResult expected = new ParseResult().setSelect(new Select(false)).setFrom(new From("a")).setWhere(
        new Where().withAncestor(
            new FunctionEvaluator("key", new StringEvaluator("'Person'"), new StringEvaluator("'Amy'"))));
    assertEquals(expected, actual);
  }
View Full Code Here

TOP

Related Classes of com.googlecode.gql4j.GqlQuery.FunctionEvaluator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.