Skip to content

Commit

Permalink
Merge branch '0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
farodin91 committed Aug 21, 2019
2 parents 816a59e + 9baae8f commit 767b2e6
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 85 deletions.
48 changes: 20 additions & 28 deletions janusgraph-es/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
</dependency>
<dependency>
<groupId>org.janusgraph</groupId>
<artifactId>janusgraph-cassandra</artifactId>
<artifactId>janusgraph-cql</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.janusgraph</groupId>
<artifactId>janusgraph-cassandra</artifactId>
<artifactId>janusgraph-cql</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -97,6 +97,11 @@
<artifactId>testcontainers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>cassandra</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>elasticsearch</artifactId>
Expand All @@ -107,6 +112,18 @@
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>

</dependencies>
<build>
<resources>
Expand Down Expand Up @@ -136,38 +153,13 @@
</executions>
</plugin>

<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>filter-cassandra-murmur-config</id>
<phase>process-test-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/cassandra/conf/localhost-murmur</outputDirectory>
<filters>
<filter>${top.level.basedir}/janusgraph-cassandra/config/cassandra-filters/localhost-murmur.properties</filter>
</filters>
<resources>
<resource>
<directory>${top.level.basedir}/janusgraph-cassandra/config/cassandra</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>

<executions>
<execution>
<id>default-test</id>
<configuration>
<argLine>${default.test.jvm.opts} -Dtest.cassandra.confdir=${project.build.directory}/cassandra/conf/localhost-murmur -Dtest.cassandra.datadir=${project.build.directory}/cassandra/data/localhost-murmur</argLine>
<skipTests>${skip.es.test}</skipTests>
<systemPropertyVariables>
<elasticsearch.docker.image>${elasticsearch.docker.image}</elasticsearch.docker.image>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,31 @@

package org.janusgraph.diskstorage.es;

import org.janusgraph.CassandraStorageSetup;
import org.janusgraph.JanusGraphCassandraContainer;
import org.janusgraph.diskstorage.configuration.ModifiableConfiguration;
import org.janusgraph.diskstorage.configuration.WriteConfiguration;
import org.janusgraph.graphdb.JanusGraphIndexTest;
import org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;

@Testcontainers
public class ThriftElasticsearchTest extends JanusGraphIndexTest {
public class CQLElasticsearchTest extends JanusGraphIndexTest {

@Container
public static JanusGraphElasticsearchContainer esr = new JanusGraphElasticsearchContainer();
private static JanusGraphElasticsearchContainer esr = new JanusGraphElasticsearchContainer();

@BeforeAll
public static void startCassandra() {
CassandraStorageSetup.startCleanEmbedded();
}
@Container
private static JanusGraphCassandraContainer cql = new JanusGraphCassandraContainer();

public ThriftElasticsearchTest() {
public CQLElasticsearchTest() {
super(true, true, true);
}

@Override
public WriteConfiguration getConfiguration() {
ModifiableConfiguration config = CassandraStorageSetup.getCassandraThriftConfiguration(ThriftElasticsearchTest.class.getName());
ModifiableConfiguration config = cql.getConfiguration(CQLElasticsearchTest.class.getName());
return esr.setConfiguration(config, INDEX)
.set(GraphDatabaseConfiguration.INDEX_MAX_RESULT_SET_SIZE, 3, INDEX)
.getConfiguration();
Expand All @@ -59,4 +57,8 @@ protected boolean supportsCollections() {
return true;
}

@Override
@Disabled("CQL seems to not clear storage correctly")
public void testClearStorage() {}

}
57 changes: 29 additions & 28 deletions janusgraph-solr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,23 @@
</dependency>
<dependency>
<groupId>org.janusgraph</groupId>
<artifactId>janusgraph-cassandra</artifactId>
<artifactId>janusgraph-cql</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
<exclusion>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-commons</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.janusgraph</groupId>
<artifactId>janusgraph-cassandra</artifactId>
<artifactId>janusgraph-cql</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
Expand Down Expand Up @@ -139,6 +149,21 @@
<version>1.13</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>cassandra</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<!-- Logging backends.
Enforce a classpath ordering constraint to ensure slf4j-log4j12
binding appears on the classpath before logback-classic.
Expand Down Expand Up @@ -169,37 +194,13 @@
</testResource>
</testResources>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>filter-cassandra-murmur-config</id>
<phase>process-test-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/cassandra/conf/localhost-murmur</outputDirectory>
<filters>
<filter>${top.level.basedir}/janusgraph-cassandra/config/cassandra-filters/localhost-murmur.properties</filter>
</filters>
<resources>
<resource>
<directory>${top.level.basedir}/janusgraph-cassandra/config/cassandra</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>default-test</id>
<configuration>
<argLine>${default.test.jvm.opts} -Dtest.cassandra.confdir=${project.build.directory}/cassandra/conf/localhost-murmur -Dtest.cassandra.datadir=${project.build.directory}/cassandra/data/localhost-murmur</argLine>
<argLine>${default.test.jvm.opts}</argLine>
<skipTests>${skip.solr.test}</skipTests>
</configuration>
</execution>
Expand Down Expand Up @@ -248,7 +249,7 @@
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<skipITs>false</skipITs>
<argLine>${default.test.jvm.opts} -Dtest.cassandra.confdir=${project.build.directory}/cassandra/conf/localhost-murmur -Dtest.cassandra.datadir=${project.build.directory}/cassandra/data/localhost-murmur</argLine>
<argLine>${default.test.jvm.opts}</argLine>
<includes>
<include>**/org/janusgraph/diskstorage/solr/*.java</include>
</includes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,25 @@

package org.janusgraph.diskstorage.solr;

import com.google.common.base.Joiner;
import org.janusgraph.CassandraStorageSetup;
import org.janusgraph.JanusGraphCassandraContainer;
import org.janusgraph.diskstorage.configuration.ModifiableConfiguration;
import org.janusgraph.diskstorage.configuration.WriteConfiguration;
import org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration;
import org.junit.jupiter.api.BeforeAll;
import java.io.File;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;

import static org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration.INDEX_BACKEND;

public class ThriftSolrTest extends SolrJanusGraphIndexTest {
@Testcontainers
public class CQLSolrTest extends SolrJanusGraphIndexTest {

@Container
private static JanusGraphCassandraContainer cql = new JanusGraphCassandraContainer();

@Override
public WriteConfiguration getConfiguration() {
ModifiableConfiguration config =
CassandraStorageSetup.getCassandraThriftConfiguration(ThriftSolrTest.class.getName());
ModifiableConfiguration config = cql.getConfiguration(CQLSolrTest.class.getName());

//Add index
config.set(SolrIndex.ZOOKEEPER_URL, SolrRunner.getZookeeperUrls(), INDEX);
config.set(SolrIndex.WAIT_SEARCHER, true, INDEX);
Expand All @@ -39,18 +42,6 @@ public WriteConfiguration getConfiguration() {
return config.getConfiguration();
}

@BeforeAll
public static void beforeClass() {
String userDir = System.getProperty("user.dir");
String cassandraDirFormat = Joiner.on(File.separator).join(userDir, userDir.contains("janusgraph-solr")
? "target" : "janusgraph-solr/target", "cassandra", "%s", "localhost-murmur");

System.setProperty("test.cassandra.confdir", String.format(cassandraDirFormat, "conf"));
System.setProperty("test.cassandra.datadir", String.format(cassandraDirFormat, "data"));

CassandraStorageSetup.startCleanEmbedded();
}

@Override
public boolean supportsWildcardQuery() {
return false;
Expand Down

0 comments on commit 767b2e6

Please sign in to comment.