Package org.cyclop.model

Examples of org.cyclop.model.CqlQuery


    vh.verifyContainsAllColumns(completion, true);
  }

  @Test
  public void testFindCompletion_Select_AfterTableName() {
    ContextCqlCompletion completion = cs.findCompletion(new CqlQuery(CqlQueryType.SELECT,
        "select * from cqldemo.mybooks "), 30);
    vh.verifyFullAndMinCompletionTheSame(completion, 4);

    ImmutableSortedSet<? extends CqlPart> cmp = completion.cqlCompletion.fullCompletion;
    vh.verifyContainsAllColumns(completion, false);
View Full Code Here


        CqlKeyword.Def.ORDER_BY.value, CqlKeyword.Def.ALLOW_FILTERING.value);
  }

  @Test
  public void testFindCompletion_Select_AfterWhere() {
    ContextCqlCompletion completion = cs.findCompletion(new CqlQuery(CqlQueryType.SELECT,
        "select * from cqldemo.mybooks  where "), 37);
    vh.verifyFullAndMinCompletionNotTheSame(completion, 18, 18);

    {
      ImmutableSortedSet<? extends CqlPart> fcmp = completion.cqlCompletion.fullCompletion;
View Full Code Here

    verifyInitialCompletion(completion);
  }

  @Test
  public void testFindCompletion_CursorOn0() {
    ContextCqlCompletion completion = cs.findCompletion(new CqlQuery(CqlQueryType.SELECT,
        "select * from cqldemo.mybooks  where "), 0);
    verifyInitialCompletion(completion);
  }
View Full Code Here

        "select * from cqldemo.mybooks  where "), 0);
    verifyInitialCompletion(completion);
  }

  private void veifySelectWithOrderBy(String cql) {
    ContextCqlCompletion completion = cs.findCompletion(new CqlQuery(CqlQueryType.SELECT, cql), -1);
    vh.verifyFullAndMinCompletionTheSame(completion, 18);

    ImmutableSortedSet<? extends CqlPart> cmp = completion.cqlCompletion.fullCompletion;
    vh.verifyContainsMybooksColumns(cmp, true);
    vh.verifyContainsAllKeyspaces(cmp, false);
View Full Code Here

    assertEquals(col.toString(), contains, col.contains(CqlKeyword.Def.COUNT_AST.value));
    assertEquals(col.toString(), contains, col.contains(CqlKeyword.Def.COUNT_ONE.value));
  }

  private void verifyCreateKeyspaceWith(String cql) {
    ContextCqlCompletion completion = cs.findCompletion(new CqlQuery(CqlQueryType.CREATE_KEYSPACE, cql));

    vh.verifyFullAndMinCompletionNotTheSame(completion, 10, 34);

    {
      ImmutableSortedSet<? extends CqlPart> mcmp = completion.cqlCompletion.minCompletion;
View Full Code Here

  @Inject
  private CompletionService cs;

  @Test(expected = BeanValidationException.class)
  public void testFindCompletion_Position_Validation_EmptyQuery() {
    cs.findCompletion(new CqlQuery(CqlQueryType.CREATE_TABLE, " "), 1);
  }
View Full Code Here

    cs.findCompletion(new CqlQuery(CqlQueryType.CREATE_TABLE, " "), 1);
  }

  @Test(expected = BeanValidationException.class)
  public void testFindCompletion_Position_Validation_NullType() {
    cs.findCompletion(new CqlQuery(null, "efqerfqef"), 1);
  }
View Full Code Here

    cs.findCompletion(new CqlQuery(null, "efqerfqef"), 1);
  }

  @Test(expected = BeanValidationException.class)
  public void testFindCompletion_Position_Validation_NullQuery() {
    cs.findCompletion(new CqlQuery(CqlQueryType.CREATE_TABLE, null), 1);
  }
View Full Code Here

    cs.findCompletion(null, -1);
  }

  @Test(expected = BeanValidationException.class)
  public void testFindCompletion_Validation_EmptyQuery() {
    cs.findCompletion(new CqlQuery(CqlQueryType.CREATE_TABLE, " "));
  }
View Full Code Here

    }
    return null;
  }

  private void process(int queryIdx) {
    CqlQuery query = queries.get(queryIdx);

    long startTime = System.currentTimeMillis();
    try {
      LOG.debug("Executing {} with offset {}", query, queryIdx);
      session.execute(query.part);
View Full Code Here

TOP

Related Classes of org.cyclop.model.CqlQuery

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.