kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | e7539f035281269a1e510021dfa5d9d4526c93c770dc7b619127b0dbe357ebfb |
|---|---|
| Author | Andrew Tolbert <andrew.tolbert@datastax.com> · 2015-04-23 12:16 -05:00 |
| Committer | Andrew Tolbert <andrew.tolbert@datastax.com> · 2015-04-23 12:16 -05:00 |
| Parents | 17dd2a64abae |
2 files changed
modified driver-core/src/test/java/com/datastax/driver/core/QueryLoggerTest.java +2 −0
| @@ -517,6 +517,7 @@ | ||
| 517 | 517 | .doesNotContain(query); |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | + @CassandraVersion(major=2.0) | |
| 520 | 521 | @Test(groups = "short") |
| 521 | 522 | public void should_show_total_statements_for_batches_even_if_query_truncated() throws Exception { |
| 522 | 523 | // given |
| @@ -563,6 +564,7 @@ | ||
| 563 | 564 | .doesNotContain(TRUNCATED_OUTPUT); |
| 564 | 565 | } |
| 565 | 566 | |
| 567 | + @CassandraVersion(major=2.0) | |
| 566 | 568 | @Test(groups = "short") |
| 567 | 569 | public void should_truncate_parameter_when_max_length_exceeded() throws Exception { |
| 568 | 570 | // given |
modified driver-core/src/test/java/com/datastax/driver/core/TimeoutStressTest.java +5 −4
| @@ -201,12 +201,12 @@ | ||
| 201 | 201 | */ |
| 202 | 202 | private static void setupSchema(Session session) throws InterruptedException, ExecutionException, TimeoutException { |
| 203 | 203 | logger.debug("Creating keyspace"); |
| 204 | - session.execute("create KEYSPACE if not exists " + KEYSPACE + | |
| 204 | + session.execute("create KEYSPACE " + KEYSPACE + | |
| 205 | 205 | " WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 3}"); |
| 206 | 206 | session.execute("use " + KEYSPACE); |
| 207 | 207 | |
| 208 | 208 | logger.debug("Creating table"); |
| 209 | - session.execute("create table if NOT EXISTS record (\n" | |
| 209 | + session.execute("create table record (\n" | |
| 210 | 210 | + " name text,\n" |
| 211 | 211 | + " phone text,\n" |
| 212 | 212 | + " value text,\n" |
| @@ -216,11 +216,12 @@ | ||
| 216 | 216 | int records = 30000; |
| 217 | 217 | List<ResultSetFuture> futures = Lists.newArrayListWithExpectedSize(records); |
| 218 | 218 | |
| 219 | + PreparedStatement insertStmt = session.prepare("insert into record (name, phone, value) values (?, ?, ?)"); | |
| 220 | + | |
| 219 | 221 | for (int i = 0; i < records; i++) { |
| 220 | 222 | if (i % 1000 == 0) |
| 221 | 223 | logger.debug("Inserting record {}.", i); |
| 222 | - futures.add(session.executeAsync( | |
| 223 | - "insert into record (name, phone, value) values (?, ?, ?)", "0", Integer.toString(i), "test")); | |
| 224 | + futures.add(session.executeAsync(insertStmt.bind("0", Integer.toString(i), "test"))); | |
| 224 | 225 | } |
| 225 | 226 | |
| 226 | 227 | statement = session.prepare("select * from " + KEYSPACE + ".record where name=? limit 1000;"); |