Examples of CqlTable


Examples of org.cyclop.model.CqlTable

  }

  @Test
  public void testMultpileParamsAllSetOk() {
    assertEquals(new CqlKeySpace("space"),
        service.mixedParams(new CqlKeySpace("space"), new CqlTable("table"), "123"));
  }
View Full Code Here

Examples of org.cyclop.model.CqlTable

  }

  @Test
  public void testMultpileParamsWithViolations() {
    try {
      service.mixedParams(new CqlKeySpace(" "), new CqlTable(" "), null);
      fail();
    } catch (BeanValidationException ve) {
      String msg = ve.getMessage();
      assertTrue(msg, msg.contains("METHOD_PARAM_INDEX_0=[ConstraintViolation"));
      assertTrue(msg, msg.contains("METHOD_PARAM_INDEX_1=[ConstraintViolation"));
View Full Code Here

Examples of org.cyclop.model.CqlTable

  @Test
  public void testReturnNullObjectViolation() {

    try {
      service.mixedParams(null, new CqlTable("table"), "123");
      fail();
    } catch (BeanValidationException ve) {
      String msg = ve.getMessage();
      assertTrue(msg, msg.contains("METHOD_RETURN_VALUE=[NULL_ROOT_OBJECT]"));
    }
View Full Code Here

Examples of org.cyclop.model.CqlTable

  @Test
  public void testFirstParamViolation() {

    try {
      service.mixedParams(null, new CqlTable(" "), "123");
      fail();
    } catch (BeanValidationException ve) {
      String msg = ve.getMessage();
      assertTrue(msg, msg.contains("METHOD_PARAM_INDEX_1="));
View Full Code Here

Examples of org.cyclop.model.CqlTable

    }
  }

  @Test(expected = ServiceException.class)
  public void testThrowsException() throws Exception {
    service.singleParamThrows(new CqlTable("throw"));
  }
View Full Code Here

Examples of org.cyclop.model.CqlTable

  public void verifyContainsTableNamesCqlDemo(Collection<? extends CqlPart> col, boolean contains) {
    col = asHahsCol(col);
    assertNotNull(col);
    assertTrue("Size:" + col.size(), col.size() >= 2);

    assertEquals(col.toString(), contains, col.contains(new CqlTable("mybooks")));
    assertEquals(col.toString(), contains, col.contains(new CqlTable("compoundtest")));
  }
View Full Code Here

Examples of org.cyclop.model.CqlTable

  public void verifyContainsTableNamesSystem(Collection<? extends CqlPart> col, boolean contains) {
    col = asHahsCol(col);
    assertNotNull(col);
    assertTrue("Size:" + col.size(), col.size() >= (contains ? 10 : 0));

    assertEquals(col.toString(), contains, col.contains(new CqlTable("sstable_activity")));
    assertEquals(col.toString(), contains, col.contains(new CqlTable("schema_triggers")));
    assertEquals(col.toString(), contains, col.contains(new CqlTable("range_xfers")));
    assertEquals(col.toString(), contains, col.contains(new CqlTable("nodeidinfo")));
    assertEquals(col.toString(), contains, col.contains(new CqlTable("local")));
    assertEquals(col.toString(), contains, col.contains(new CqlTable("compactions_in_progress")));
    assertEquals(col.toString(), contains, col.contains(new CqlTable("compaction_history")));
  }
View Full Code Here

Examples of org.cyclop.model.CqlTable

  public void verifyContainsTableNamesWithSpaceCqlDemo(Collection<? extends CqlPart> col, boolean contains) {
    col = asHahsCol(col);
    assertNotNull(col);
    assertTrue("Size:" + col.size(), col.size() >= 2);

    assertEquals(col.toString(), contains, col.contains(new CqlTable("cqldemo", "mybooks")));
    assertEquals(col.toString(), contains, col.contains(new CqlTable("cqldemo", "compoundtest")));
  }
View Full Code Here

Examples of org.cyclop.model.CqlTable

    if (!tableOpt.isPresent()) {
      return -1;
    }

    int index = -1;
    CqlTable table = tableOpt.get();
    if (queryService.checkTableExists(table)) {
      index = query.partLc.indexOf(table.partLc) + table.partLc.length();
    }
    return index;
  }
View Full Code Here

Examples of org.cyclop.model.CqlTable

    if (candidate == null) {
      return Optional.empty();
    }

    // check whether we have table with keyspace
    CqlTable result = null;
    if (candidate.contains(".") && !candidate.endsWith(".")) {
      String[] talStr = candidate.split("[.]");
      String keyspaceStr = StringUtils.trimToNull(talStr[0]);
      String tableStr = StringUtils.trimToNull(talStr[1]);
      if (tableStr == null) {
        result = null;
      } else {
        if (keyspaceStr == null) {
          result = new CqlTable(candidate);
        } else {
          result = new CqlTable(keyspaceStr, tableStr);
        }
      }

    } else {
      result = new CqlTable(candidate);
    }

    LOG.debug("Extracted table {} from {}, {}", result, cqlKeyword, query);
    return Optional.ofNullable(result);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.