Package org.cyclop.model

Examples of org.cyclop.model.CqlQuery$CqlQueryJaxb


    Iterator<QueryEntry> favIt = fav.iterator();
    assertEquals(50, fav.size());
    assertEquals(50, history.size());
    for (int i = 0; i < 50; i++) {
      assertTrue(favIt.hasNext());
      CqlQuery query = new CqlQuery(CqlQueryType.SELECT, "select * from MyTable where id=" + i);
      assertTrue(history.contains(new QueryEntry(query, 7754)));
      assertTrue(history.contains(favIt.next()));
    }
  }
View Full Code Here


    {
      QueryHistory history = new QueryHistory();

      for (int i = 0; i < 600; i++) {
        CqlQuery query = new CqlQuery(CqlQueryType.SELECT, "select * from MyTable1 where id=" + i);
        history.add(new QueryEntry(query, 4563));
      }
      assertEquals(500, history.size());
      testHistRange(history, 599, 100);
      storage.store(userId, history);
    }

    {
      Optional<QueryHistory> history = storage.read(userId, QueryHistory.class);
      assertNotNull(history);
      assertEquals(500, history.get().size());
      testHistRange(history.get(), 599, 100);

      for (int i = 0; i < 10; i++) {
        CqlQuery query = new CqlQuery(CqlQueryType.SELECT, "select * from MyTable2 where id=" + i);
        history.get().add(new QueryEntry(query, 567));
      }
      storage.store(userId, history.get());
    }

View Full Code Here

  @Inject
  private CsvQueryResultExporter exporter;

  @Test
  public void testExportAsCsv_ResultEmpty() {
    CqlQuery query = new CqlQuery(CqlQueryType.SELECT, "select id from cqldemo.mybooks where pages=-1");
    String exportRsult = exporter.exportAsCsv(query);
    assertNotNull(exportRsult);

    try (Scanner scanner = new Scanner(exportRsult)) {
      int lineIndex = 0;
View Full Code Here

    }
  }

  @Test
  public void testExportAsCsv_SelectIdsFromMyBooks() {
    CqlQuery query = new CqlQuery(CqlQueryType.SELECT, "select id from cqldemo.mybooks where pages=2299");
    String exportRsult = exporter.exportAsCsv(query);
    assertNotNull(exportRsult);

    try (Scanner scanner = new Scanner(exportRsult)) {
      int lineIndex = 0;
View Full Code Here

    }
  }

  @Test
  public void testExportAsCsv_SelectAutorsAndGerneFromMyBooks() {
    CqlQuery query = new CqlQuery(CqlQueryType.SELECT,
        "select authors, genre from cqldemo.mybooks where pages=2299");
    String exportRsult = exporter.exportAsCsv(query);
    assertNotNull(exportRsult);

    try (Scanner scanner = new Scanner(exportRsult)) {
View Full Code Here

    }
  }

  @Test
  public void testExportAsCsv_SelectAllFromMyBooks() {
    CqlQuery query = new CqlQuery(CqlQueryType.SELECT, "select * from cqldemo.mybooks where pages=2299");
    String exportRsult = exporter.exportAsCsv(query);
    assertNotNull(exportRsult);

    try (Scanner scanner = new Scanner(exportRsult)) {
      int lineIndex = 0;
View Full Code Here

    vh.verifyIsEmpty(index);
  }

  @Test(expected = BeanValidationException.class)
  public void testFindColumnNames_ViolationEmpty() {
    qs.execute(new CqlQuery(CqlQueryType.USE, " "));
  }
View Full Code Here

    qs.execute(null);
  }

  @Test
  public void testFindColumnNames_KeyspaceInSession() {
    qs.execute(new CqlQuery(CqlQueryType.USE, "use cqldemo"));
    ImmutableSortedSet<CqlColumnName> resp = qs.findColumnNames(Optional.of(new CqlTable("MyBooks")));
    assertNotNull(resp);
    assertTrue("readSize: " + resp.size(), resp.size() > 5);
    vh.verifyContainsMybooksColumns(resp, true);
    vh.verifyContainsSystemColumns(resp, false);
View Full Code Here

    vh.verifyContainsCompoundTestColumns(allColumnNames, true);
  }

  @Test
  public void testExecute_CompoundPkNoDynamicColumns() {
    qs.execute(new CqlQuery(CqlQueryType.USE, "USE CqlDemo"));
    CqlQuery query = new CqlQuery(CqlQueryType.SELECT, "select * from CompoundTest where deesc='TEST_SET_1'");
    try (QueryHistory.HistoryIterator iterator = hs.read().iterator()) {
      assertNotSame(query, iterator.next().query);
    }
    CqlQueryResult res = qs.execute(query);
    try (QueryHistory.HistoryIterator iterator = hs.read().iterator()) {
View Full Code Here

    assertEquals(50, rowsCnt);
  }

  @Test(expected = BeanValidationException.class)
  public void testExecute_IncorrectParams() {
    qs.execute(new CqlQuery(null, null));
  }
View Full Code Here

TOP

Related Classes of org.cyclop.model.CqlQuery$CqlQueryJaxb

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.