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

Update cassandra2-cql driver to only run tests on jdk8
This commit is contained in:
Sean Busbey 2016-03-30 07:54:20 -05:00
Родитель c44906c98e b5c38b29a2
Коммит 6d2f9031f3
3 изменённых файлов: 34 добавлений и 13 удалений

Просмотреть файл

@ -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 {
if (client != null) {
client.cleanup();
}
client = null;
}
@ -96,8 +94,10 @@ public class CassandraCQLClientTest {
public void clearTable() throws Exception {
// Clear the table so that each test starts fresh.
final Statement truncate = QueryBuilder.truncate(TABLE);
if (cassandraUnit != null) {
cassandraUnit.getSession().execute(truncate);
}
}
@Test
public void testReadMissingRow() throws Exception {

Просмотреть файл

@ -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>