protected void clearKeyspace() { // Drop keyspace with non-keyspace-session Statement stmt = SchemaBuilder.dropKeyspace(this.keyspace).ifExists(); LOG.debug("Drop keyspace: {}", stmt); Session session = this.cluster().connect(); try { session.execute(stmt); } finally { if (!session.isClosed()) { session.close(); } } }
@Test(groups = "unit") public void should_drop_keyspace_if_exists() throws Exception { // When SchemaStatement statement = dropKeyspace("test").ifExists(); // Then assertThat(statement.getQueryString()).isEqualTo("DROP KEYSPACE IF EXISTS test"); } }
@Override public void deleteAll() throws Exception { state.tableExistsCache.clear(); state.preparedRangeReadsPerTable.clear(); state.preparedRowReadPerTable.clear(); state.preparedWritesPerTable.clear(); session.execute(SchemaBuilder.dropKeyspace(gwNamespace).ifExists()); }
protected void clearKeyspace() { // Drop keyspace with non-keyspace-session Statement stmt = SchemaBuilder.dropKeyspace(this.keyspace).ifExists(); LOG.debug("Drop keyspace: {}", stmt); Session session = this.cluster().connect(); try { session.execute(stmt); } finally { if (!session.isClosed()) { session.close(); } } }
@Test(groups = "unit") public void should_drop_keyspace_if_exists() throws Exception { // When SchemaStatement statement = dropKeyspace("test").ifExists(); // Then assertThat(statement.getQueryString()).isEqualTo("DROP KEYSPACE IF EXISTS test"); } }