From f4e7a3721fde7748461648bea863e5659ded7760 Mon Sep 17 00:00:00 2001 From: Muhammed Uluyol Date: Thu, 4 Feb 2016 21:39:11 -0500 Subject: [PATCH 1/4] [cassandra2] Update to use the new driver version Fixes #612. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 35105dade9..5c52598527 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ LICENSE file. 1.6.0 1.2.9 1.0.3 - 2.1.8 + 3.0.0 1.0.0-incubating.M1 7.2.2.Final 0.6.0 From 0965558a7f8fe70aa570d760a52fc7dca3c5fc76 Mon Sep 17 00:00:00 2001 From: Muhammed Uluyol Date: Sat, 19 Mar 2016 18:20:32 -0400 Subject: [PATCH 2/4] [cassandra2] Update cassandra-unit --- cassandra2/pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cassandra2/pom.xml b/cassandra2/pom.xml index f0f19edecc..a5c34b12c7 100644 --- a/cassandra2/pom.xml +++ b/cassandra2/pom.xml @@ -46,8 +46,9 @@ LICENSE file. org.cassandraunit - cassandra-unit-shaded - 2.1.9.2 + cassandra-unit + 3.0.0.1 + shaded test From 1aa8c33bd4f4cbd9c074e8cfa5e39baa71217424 Mon Sep 17 00:00:00 2001 From: Muhammed Uluyol Date: Thu, 24 Mar 2016 23:12:41 -0400 Subject: [PATCH 3/4] [cassandra2] Only test on Java 8+ --- .../yahoo/ycsb/db/CassandraCQLClientTest.java | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/cassandra2/src/test/java/com/yahoo/ycsb/db/CassandraCQLClientTest.java b/cassandra2/src/test/java/com/yahoo/ycsb/db/CassandraCQLClientTest.java index bc73a73710..8336dc0792 100644 --- a/cassandra2/src/test/java/com/yahoo/ycsb/db/CassandraCQLClientTest.java +++ b/cassandra2/src/test/java/com/yahoo/ycsb/db/CassandraCQLClientTest.java @@ -41,6 +41,7 @@ import org.cassandraunit.CassandraCQLUnit; import org.cassandraunit.dataset.cql.ClassPathCQLDataSet; import org.junit.After; +import org.junit.Assume; import org.junit.Before; import org.junit.ClassRule; import org.junit.Test; @@ -63,11 +64,16 @@ public class CassandraCQLClientTest { private Session session; @ClassRule - public static CassandraCQLUnit cassandraUnit = - new CassandraCQLUnit(new ClassPathCQLDataSet("ycsb.cql", "ycsb")); + public static CassandraCQLUnit cassandraUnit = new CassandraCQLUnit(new ClassPathCQLDataSet("ycsb.cql", "ycsb")); @Before - public void setUpClient() throws Exception { + public void setUp() throws Exception { + // check that this is Java 8+ + int javaVersion = Integer.parseInt(System.getProperty("java.version").split("\\.")[1]); + Assume.assumeTrue(javaVersion >= 8); + + session = cassandraUnit.getSession(); + Properties p = new Properties(); p.setProperty("hosts", HOST); p.setProperty("port", Integer.toString(PORT)); @@ -81,14 +87,11 @@ public void setUpClient() throws Exception { client.init(); } - @Before - public void setSession() { - session = cassandraUnit.getSession(); - } - @After public void tearDownClient() throws Exception { - client.cleanup(); + if (client != null) { + client.cleanup(); + } client = null; } @@ -96,7 +99,9 @@ public void tearDownClient() throws Exception { public void clearTable() throws Exception { // Clear the table so that each test starts fresh. final Statement truncate = QueryBuilder.truncate(TABLE); - cassandraUnit.getSession().execute(truncate); + if (cassandraUnit != null) { + cassandraUnit.getSession().execute(truncate); + } } @Test From b5c38b29a293d78a08190ebca8f4273c971f0794 Mon Sep 17 00:00:00 2001 From: Sean Busbey Date: Fri, 25 Mar 2016 02:01:11 -0500 Subject: [PATCH 4/4] [cassandra2] switch to maven profile to skip tests under jdk7. --- cassandra2/pom.xml | 20 +++++++++++++++++++ .../yahoo/ycsb/db/CassandraCQLClientTest.java | 5 ----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/cassandra2/pom.xml b/cassandra2/pom.xml index a5c34b12c7..fccd4b3281 100644 --- a/cassandra2/pom.xml +++ b/cassandra2/pom.xml @@ -31,6 +31,11 @@ LICENSE file. Cassandra 2.1+ DB Binding jar + + + true + + @@ -58,4 +63,19 @@ LICENSE file. test + + + + + jdk8-tests + + 1.8 + + + false + + + diff --git a/cassandra2/src/test/java/com/yahoo/ycsb/db/CassandraCQLClientTest.java b/cassandra2/src/test/java/com/yahoo/ycsb/db/CassandraCQLClientTest.java index 8336dc0792..60b7e2f33f 100644 --- a/cassandra2/src/test/java/com/yahoo/ycsb/db/CassandraCQLClientTest.java +++ b/cassandra2/src/test/java/com/yahoo/ycsb/db/CassandraCQLClientTest.java @@ -41,7 +41,6 @@ import org.cassandraunit.CassandraCQLUnit; import org.cassandraunit.dataset.cql.ClassPathCQLDataSet; import org.junit.After; -import org.junit.Assume; import org.junit.Before; import org.junit.ClassRule; import org.junit.Test; @@ -68,10 +67,6 @@ public class CassandraCQLClientTest { @Before public void setUp() throws Exception { - // check that this is Java 8+ - int javaVersion = Integer.parseInt(System.getProperty("java.version").split("\\.")[1]); - Assume.assumeTrue(javaVersion >= 8); - session = cassandraUnit.getSession(); Properties p = new Properties();