Skip to content

Commit

Permalink
[ issue #10] Added maven profiles with Cassandra and Failsafe plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
agazzarini committed Aug 19, 2014
1 parent d36afd4 commit 171c1bd
Show file tree
Hide file tree
Showing 14 changed files with 404 additions and 98 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ target

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
cachefile

This file was deleted.

16 changes: 0 additions & 16 deletions jena-nosql-framework/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,4 @@
<version>17.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
import org.gazzax.labs.jena.nosql.fwk.dictionary.TopLevelDictionary;
import org.gazzax.labs.jena.nosql.fwk.ds.MapDAO;
import org.gazzax.labs.jena.nosql.fwk.ds.TripleIndexDAO;
import org.gazzax.labs.jena.nosql.fwk.graph.NoSqlDatasetGraph;
import org.gazzax.labs.jena.nosql.fwk.graph.NoSqlGraph;

import com.hp.hpl.jena.graph.Graph;
import com.hp.hpl.jena.sparql.core.DatasetGraph;

/**
* Main entry / extension point of the jena-nosql framework.
Expand Down Expand Up @@ -74,6 +76,15 @@ public Graph getGraph() {
return new NoSqlGraph(this);
}

/**
* Returns the {@link DatasetGraph} associated with the underlying kind of storage.
*
* @return the {@link DatasetGraph} associated with the underlying kind of storage.
*/
public DatasetGraph getDatasetGraph() {
return new NoSqlDatasetGraph(this);
}

/**
* Factory method for obtaining a concrete factory.
* As you can see, the method doesn't allow to specificy the factory. That because it uses the {@link ServiceLoader} mechanism to do that.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public ClientShutdownHook getClientShutdownHook() {
public final static StorageLayerFactory STORAGE_LAYER_FACTORY = new TestStorageLayerFactory();

public final static Random RANDOMIZER = new Random();
public final static String DUMMY_BASE_URI = "http://example.org/";

/**
* Produces a random string.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void initialStateMustBeStrategyOne() {
@Test
public void callInInvalidState() {
try {
cut.getParameter(anyString(), anyString());
cut.getParameter(randomString(), randomString());
fail();
} catch (final IllegalStateException expected) {
// Nothing, this is the expected behaviour.
Expand Down
46 changes: 46 additions & 0 deletions jena-nosql-framework/src/test/resources/jena-nosql-default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
##########################################
## JENA-NOSQL default configuration ##
##########################################

# Cassandra nodes (comma seperated) actings as initial contact points
cassandra-contact-points: "localhost"
cassandra-keyspace: "C2XDB"

cassandra-connect-timeout-millis: 5000
cassandra-read-timeout-millis: 12000
#cassandra-keep-alive: true
#cassandra-reuse-address: true
#cassandra-receive-buffer-size: 1000
#cassandra-so-linger: 1000
#cassandra-tcp-no-delay: false

#cassandra-consistency-level: "ONE"
#cassandra-serial-consistency-level: "SERIAL"
#cassandra-fetch-size: 100

# Datastax driver retry policy
#cassandra-retry-policy: "<class name>"

# Datastax driver load balancing policy
#cassandra-load-balancing-policy: "<class name>"

# Datastax driver reconnection policy
#cassandra-reconnection-policy: "<class name>"

# Datastax driver compression to use for the transport
#cassandra-transport-compression: "NONE"

# Datastac pooling connection options
#cassandra-local-core-connections-per-host: 10
#cassandra-local-max-connections-per-host: 10
#cassandra-local-max-simultaneous-request-per-connection-threshold: 10
#cassandra-local-min-simultaneous-request-per-connection-threshold: 10
#cassandra-remote-core-connections-per-host: 10
#cassandra-remote-max-connections-per-host: 10
#cassandra-remote-max-simultaneous-request-per-connection-threshold: 10
#cassandra-remote-min-simultaneous-request-per-connection-threshold: 10

cassandra-replication-factor: 1
cassandra-read-consistency: "ONE"
cassandra-write-consistency: "ONE"
66 changes: 66 additions & 0 deletions jena-nosql-integration-tests/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>jena-nosql</artifactId>
<groupId>org.gazzax.labs</groupId>
<version>1.0</version>
<relativePath>..</relativePath>
</parent>
<artifactId>jena-nosql-integration-tests</artifactId>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>cassandra-2x</id>
<dependencies>
<dependency>
<groupId>org.gazzax.labs</groupId>
<artifactId>jena-nosql-binding-cassandra</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cassandra-maven-plugin</artifactId>
<version>2.0.0-1</version>
<configuration>
<startNativeTransport>true</startNativeTransport>
</configuration>
<executions>
<execution>
<goals>
<goal>start</goal>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.gazzax.labs</groupId>
<artifactId>jena-nosql-framework</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</project>
Loading

0 comments on commit 171c1bd

Please sign in to comment.