Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cassandra2-cql driver to only run tests on jdk8 #669

Merged
merged 4 commits into from
Mar 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions cassandra2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -81,22 +82,21 @@ 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;
}

@After
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
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down