Package com.googlecode.gql4j.GqlQuery

Examples of com.googlecode.gql4j.GqlQuery.DecimalEvaluator


    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


    assertEquals(new DecimalEvaluator("1"), parser("1").value().r);
  }
 
  @Test
  public void testCondition_1() throws RecognitionException {
    Condition expected = new Condition("a", FilterOperator.EQUAL, new DecimalEvaluator("1"));   
    Condition actual = parser("a=1").condition().r;
   
    assertEquals(expected, actual);
  }
View Full Code Here

 
  @Test
  public void testParseWhere_1() {
    ParseResult actual = GqlQuery.parse("SELECT * from a where a = 1");
    ParseResult expected = new ParseResult().setSelect(new Select(false)).setFrom(new From("a")).setWhere(
        new Where().withCondition(new Condition("a", FilterOperator.EQUAL, new DecimalEvaluator("1"))));
    assertEquals(expected, actual);
  }
View Full Code Here

 
  @Test
  public void testParseWhere_2() {
    ParseResult actual = GqlQuery.parse("SELECT * from a where a = 1 and b <= '3'");
    ParseResult expected = new ParseResult().setSelect(new Select(false)).setFrom(new From("a")).setWhere(
        new Where().withCondition(new Condition("a", FilterOperator.EQUAL, new DecimalEvaluator("1")))
        .withCondition(new Condition("b", FilterOperator.LESS_THAN_OR_EQUAL, new StringEvaluator("'3'")))
        );
    assertEquals(expected, actual);
  }
View Full Code Here

TOP

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

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.