Elffuss BraidHub

kikocis/java-driver public

1.2 test compatibility.
Changesete7539f035281269a1e510021dfa5d9d4526c93c770dc7b619127b0dbe357ebfb
AuthorAndrew Tolbert <andrew.tolbert@datastax.com> · 2015-04-23 12:16 -05:00
CommitterAndrew Tolbert <andrew.tolbert@datastax.com> · 2015-04-23 12:16 -05:00
Parents17dd2a64abae

Browse the files at this changeset

2 files changed

modified driver-core/src/test/java/com/datastax/driver/core/QueryLoggerTest.java +2 −0
@@ -517,6 +517,7 @@
517517 .doesNotContain(query);
518518 }
519519
520+ @CassandraVersion(major=2.0)
520521 @Test(groups = "short")
521522 public void should_show_total_statements_for_batches_even_if_query_truncated() throws Exception {
522523 // given
@@ -563,6 +564,7 @@
563564 .doesNotContain(TRUNCATED_OUTPUT);
564565 }
565566
567+ @CassandraVersion(major=2.0)
566568 @Test(groups = "short")
567569 public void should_truncate_parameter_when_max_length_exceeded() throws Exception {
568570 // given
modified driver-core/src/test/java/com/datastax/driver/core/TimeoutStressTest.java +5 −4
@@ -201,12 +201,12 @@
201201 */
202202 private static void setupSchema(Session session) throws InterruptedException, ExecutionException, TimeoutException {
203203 logger.debug("Creating keyspace");
204- session.execute("create KEYSPACE if not exists " + KEYSPACE +
204+ session.execute("create KEYSPACE " + KEYSPACE +
205205 " WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 3}");
206206 session.execute("use " + KEYSPACE);
207207
208208 logger.debug("Creating table");
209- session.execute("create table if NOT EXISTS record (\n"
209+ session.execute("create table record (\n"
210210 + " name text,\n"
211211 + " phone text,\n"
212212 + " value text,\n"
@@ -216,11 +216,12 @@
216216 int records = 30000;
217217 List<ResultSetFuture> futures = Lists.newArrayListWithExpectedSize(records);
218218
219+ PreparedStatement insertStmt = session.prepare("insert into record (name, phone, value) values (?, ?, ?)");
220+
219221 for (int i = 0; i < records; i++) {
220222 if (i % 1000 == 0)
221223 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")));
224225 }
225226
226227 statement = session.prepare("select * from " + KEYSPACE + ".record where name=? limit 1000;");