#224 - Use external or embedded (if external Apache Cassandra is not available) for Cassandra examples.

We now check whether an external Apache Cassandra instance is available at localhost:9042 and use it to run the examples. Otherwise, if no external Apache Cassandra instance is available, we start an embedded Cassandra instance.
This commit is contained in:
Mark Paluch
2017-01-04 10:59:14 +01:00
committed by Oliver Gierke
parent 1d3af17572
commit d9f77903ef
21 changed files with 1081 additions and 213 deletions

View File

@@ -15,10 +15,11 @@
*/
package example.springdata.cassandra.java8;
import example.springdata.cassandra.util.RequiresCassandraKeyspace;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import example.springdata.cassandra.util.CassandraKeyspace;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -41,8 +42,8 @@ import org.springframework.test.context.junit4.SpringRunner;
@SpringBootTest(classes = CassandraConfiguration.class)
public class Java8IntegrationTests {
@ClassRule
public final static RequiresCassandraKeyspace CASSANDRA_KEYSPACE = RequiresCassandraKeyspace.onLocalhost().atLeast(Version.parse("3.0"));
@ClassRule public final static CassandraKeyspace CASSANDRA_KEYSPACE = CassandraKeyspace.onLocalhost()
.atLeast(Version.parse("3.0"));
@Autowired PersonRepository repository;

View File

@@ -18,6 +18,8 @@ package example.springdata.cassandra.java8;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import example.springdata.cassandra.util.CassandraKeyspace;
import java.time.LocalDate;
import java.time.ZoneId;
@@ -30,8 +32,6 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.util.Version;
import org.springframework.test.context.junit4.SpringRunner;
import example.springdata.cassandra.util.RequiresCassandraKeyspace;
/**
* Integration test to show the usage of JSR-310 date/time types with Spring Data Cassandra.
*
@@ -41,7 +41,7 @@ import example.springdata.cassandra.util.RequiresCassandraKeyspace;
@SpringBootTest(classes = CassandraConfiguration.class)
public class Jsr310IntegrationTests {
@ClassRule public final static RequiresCassandraKeyspace CASSANDRA_KEYSPACE = RequiresCassandraKeyspace.onLocalhost()
@ClassRule public final static CassandraKeyspace CASSANDRA_KEYSPACE = CassandraKeyspace.onLocalhost()
.atLeast(Version.parse("3.0"));
@Autowired OrderRepository repository;