Skip to content
Snippets Groups Projects
Commit 6d2f9031 authored by Sean Busbey's avatar Sean Busbey
Browse files

Merge pull request #669 from busbey/update-cassandra-driver

Update cassandra2-cql driver to only run tests on jdk8
parents c44906c9 b5c38b29
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,11 @@ LICENSE file.
<name>Cassandra 2.1+ DB Binding</name>
<packaging>jar</packaging>
<properties>
<!-- Skip tests by default. will be activated by jdk8 profile -->
<skipTests>true</skipTests>
</properties>
<dependencies>
<!-- CQL driver -->
<dependency>
......@@ -46,8 +51,9 @@ LICENSE file.
</dependency>
<dependency>
<groupId>org.cassandraunit</groupId>
<artifactId>cassandra-unit-shaded</artifactId>
<version>2.1.9.2</version>
<artifactId>cassandra-unit</artifactId>
<version>3.0.0.1</version>
<classifier>shaded</classifier>
<scope>test</scope>
</dependency>
<dependency>
......@@ -57,4 +63,19 @@ LICENSE file.
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<!-- Cassandra 2.2+ requires JDK8 to run, so none of our tests
will work unless we're using jdk8.
-->
<profile>
<id>jdk8-tests</id>
<activation>
<jdk>1.8</jdk>
</activation>
<properties>
<skipTests>false</skipTests>
</properties>
</profile>
</profiles>
</project>
......@@ -63,11 +63,12 @@ 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 {
session = cassandraUnit.getSession();
Properties p = new Properties();
p.setProperty("hosts", HOST);
p.setProperty("port", Integer.toString(PORT));
......@@ -81,14 +82,11 @@ public class CassandraCQLClientTest {
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 +94,9 @@ public class CassandraCQLClientTest {
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
......
......@@ -74,7 +74,7 @@ LICENSE file.
<accumulo.version>1.6.0</accumulo.version>
<cassandra.version>1.2.9</cassandra.version>
<cassandra.cql.version>1.0.3</cassandra.cql.version>
<cassandra2.cql.version>2.1.8</cassandra2.cql.version>
<cassandra2.cql.version>3.0.0</cassandra2.cql.version>
<geode.version>1.0.0-incubating.M1</geode.version>
<infinispan.version>7.2.2.Final</infinispan.version>
<kudu.version>0.6.0</kudu.version>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment