private void alterEndpointProfileTable() { try { cassandraSession.execute("ALTER TABLE ep_profile ADD eps_cf_hash blob;"); } catch (InvalidQueryException ex) { LOG.warn("Failed to alter ep_profile table: {}", ex.getMessage()); } }
if (!e.getMessage().startsWith("unconfigured columnfamily row_key"))
@Override public DriverException copy() { return new InvalidQueryException(getAddress(), getMessage(), this); }
@Test(groups = "unit") public void should_create_proper_invalid_query_exception() { InvalidQueryException e = new InvalidQueryException("Bad, really bad"); assertThat(e.getMessage()).isEqualTo("Bad, really bad"); e = (InvalidQueryException) e.copy(); assertThat(e.getMessage()).isEqualTo("Bad, really bad"); }
} catch (InvalidQueryException e) { if (!e.getMessage().contains(String.format( "Keyspace '%s' does not exist", this.keyspace))) { throw e;
@Test(groups = "unit") public void should_create_proper_invalid_configuration_in_query_exception() { InvalidConfigurationInQueryException e = new InvalidConfigurationInQueryException(address1, "Bad, really bad"); assertThat(e.getMessage()).isEqualTo("Bad, really bad"); assertThat(e.getAddress()).isEqualTo(address1); assertThat(e.getHost()).isEqualTo(address1.getAddress()); InvalidQueryException e1 = (InvalidQueryException) e.copy(); assertThat(e1.getMessage()).isEqualTo("Bad, really bad"); }
@Override public DriverException copy() { return new InvalidQueryException(getMessage(), this); } }
private void error(KeySpaceQueryInformation information, CreateKeySpace createKeySpace, InvalidQueryException exception) { StringBuilder error = new StringBuilder(); error.append(" An error happened when execute create keyspace: ") .append(information.getKeySpace()); error.append(" with type: ").append(information.getReplicaStrategy()); error.append(" With query: ").append( createKeySpace.createQuery(information)); error.append(" Error cause: ").append(exception.getCause()).append(" ") .append(exception.getMessage()); throw new CreateKeySpaceException(error.toString()); }
@Override public DriverException copy() { return new InvalidQueryException(getAddress(), getMessage(), this); }
@Override public DriverException copy() { return new InvalidQueryException(getAddress(), getMessage(), this); }
@Override public DriverException copy() { return new InvalidQueryException(getAddress(), getMessage(), this); }
@Test(groups = "unit") public void should_create_proper_invalid_query_exception() { InvalidQueryException e = new InvalidQueryException("Bad, really bad"); assertThat(e.getMessage()).isEqualTo("Bad, really bad"); e = (InvalidQueryException) e.copy(); assertThat(e.getMessage()).isEqualTo("Bad, really bad"); }
} catch (InvalidQueryException e) { if (!e.getMessage().contains(String.format( "Keyspace '%s' does not exist", this.keyspace))) { throw e;
@Test(groups = "unit") public void should_create_proper_invalid_configuration_in_query_exception() { InvalidConfigurationInQueryException e = new InvalidConfigurationInQueryException(address1, "Bad, really bad"); assertThat(e.getMessage()).isEqualTo("Bad, really bad"); assertThat(e.getAddress()).isEqualTo(address1); assertThat(e.getHost()).isEqualTo(address1.getAddress()); InvalidQueryException e1 = (InvalidQueryException) e.copy(); assertThat(e1.getMessage()).isEqualTo("Bad, really bad"); }
fail("Expecting IQE"); } catch (InvalidQueryException e) { assertThat(e.getMessage()).isEqualTo("Undefined column name clustering1"); fail("Expecting IQE"); } catch (InvalidQueryException e) { assertThat(e.getMessage()).isEqualTo("Undefined column name z"); fail("Expecting IQE"); } catch (InvalidQueryException e) { assertThat(e.getMessage()) .isEqualTo("Group by is not supported on only a part of the partition key");
/** * Validates that if a provided {@link DateRange} for a 'DateRangeType' column has the bounds * reversed (lower bound is later than upper bound) that an {@link InvalidQueryException} is * thrown. * * @jira_ticket JAVA-1319 * @test_category data_types:primitive */ @Test(groups = "short") public void should_disallow_invalid_order() throws Exception { session() .execute("CREATE TABLE dateRangeIntegrationTest3 (k int PRIMARY KEY, v 'DateRangeType')"); try { session() .execute( "INSERT INTO dateRangeIntegrationTest3 (k, v) VALUES (1, '[2020-01-01T10:15:30.009Z TO 2010-01-01T00:05:11.031Z]')"); fail("Expected InvalidQueryException"); } catch (InvalidQueryException e) { assertThat(e.getMessage()) .contains("Wrong order: 2020-01-01T10:15:30.009Z TO 2010-01-01T00:05:11.031Z") .contains( "Could not parse date range: [2020-01-01T10:15:30.009Z TO 2010-01-01T00:05:11.031Z]"); } }
fail("Expecting IQE"); } catch (InvalidQueryException e) { assertThat(e.getMessage()).isEqualTo("Undefined column name clustering1"); fail("Expecting IQE"); } catch (InvalidQueryException e) { assertThat(e.getMessage()).isEqualTo("Undefined column name z"); fail("Expecting IQE"); } catch (InvalidQueryException e) { assertThat(e.getMessage()) .isEqualTo("Group by is not supported on only a part of the partition key");