Skip to content

Commit

Permalink
Merge pull request #159 from eclipse/tck_driver
Browse files Browse the repository at this point in the history
Appends the TCK drivers to the NoSQL drivers
  • Loading branch information
otaviojava authored May 27, 2020
2 parents 81898b8 + 2d2b1e2 commit 1c9b90f
Show file tree
Hide file tree
Showing 70 changed files with 944 additions and 61 deletions.
30 changes: 29 additions & 1 deletion arangodb-driver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<description>The Eclipse JNoSQL communication layer, Diana, to AranboDB</description>

<properties>
<arango.driver>6.6.2</arango.driver>
<arango.driver>6.6.3</arango.driver>
</properties>
<dependencies>
<dependency>
Expand All @@ -51,5 +51,33 @@
<artifactId>arangodb-java-driver</artifactId>
<version>${arango.driver}</version>
</dependency>
<dependency>
<groupId>jakarta.nosql.tck.communication.driver</groupId>
<artifactId>driver-tck-key-value</artifactId>
<version>${jakarta.nosql.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.nosql.tck.communication.driver</groupId>
<artifactId>driver-tck-document</artifactId>
<version>${jakarta.nosql.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration>
<dependenciesToScan>
<dependency>jakarta.nosql.tck.communication.driver:driver-tck-key-value</dependency>
<dependency>jakarta.nosql.tck.communication.driver:driver-tck-document</dependency>
</dependenciesToScan>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.arangodb.ArangoDB;
import jakarta.nosql.document.DocumentCollectionManagerFactory;

final class ArangoDBDocumentCollectionManagerFactory implements DocumentCollectionManagerFactory{
final class ArangoDBDocumentCollectionManagerFactory implements DocumentCollectionManagerFactory {


private final ArangoDB arangoDB;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2020 Otávio Santana and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.
*
* You may elect to redistribute this code under either of these licenses.
*
* Contributors:
*
* Otavio Santana
*/
package org.eclipse.jnosql.diana.arangodb.document;

import jakarta.nosql.document.DocumentCollectionManager;
import jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier;

import static org.eclipse.jnosql.diana.arangodb.document.ArangoDBDocumentCollectionManagerFactorySupplier.INSTANCE;

public class ArangoDBDocumentCollectionManagerSupplier implements DocumentCollectionManagerSupplier {

private static final String DATABASE = "tck-database";

@Override
public DocumentCollectionManager get() {
return INSTANCE.get().get(DATABASE);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2020 Otávio Santana and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.
*
* You may elect to redistribute this code under either of these licenses.
*
* Contributors:
*
* Otavio Santana
*/
package org.eclipse.jnosql.diana.arangodb.keyvalue;

import jakarta.nosql.keyvalue.BucketManager;
import jakarta.nosql.keyvalue.BucketManagerFactory;
import jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier;

public class ArangoDBBucketManagerSupplier implements BucketManagerSupplier {

private static final String BUCKET = "tck-users-entity";

@Override
public BucketManager get() {
final BucketManagerFactory factory = BucketManagerFactorySupplier.INSTANCE.get();
return factory.getBucketManager(BUCKET);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.eclipse.jnosql.diana.arangodb.document.ArangoDBDocumentCollectionManagerSupplier
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.eclipse.jnosql.diana.arangodb.keyvalue.ArangoDBBucketManagerSupplier
3 changes: 3 additions & 0 deletions arangodb-driver/src/test/resources/document.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
query.1=insert person {"_id": 1, "name": "Diana"}
query.2=insert person {"_id": 2, "name": "Artemis"}
id.name=_id
21 changes: 21 additions & 0 deletions cassandra-driver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,26 @@
<artifactId>java-driver-query-builder</artifactId>
<version>${casandra.driver.version}</version>
</dependency>
<dependency>
<groupId>jakarta.nosql.tck.communication.driver</groupId>
<artifactId>driver-tck-column</artifactId>
<version>${jakarta.nosql.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration>
<dependenciesToScan>
<dependency>jakarta.nosql.tck.communication.driver:driver-tck-column</dependency>
</dependenciesToScan>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2020 Otávio Santana and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.
*
* You may elect to redistribute this code under either of these licenses.
*
* Contributors:
*
* Otavio Santana
*/
package org.eclipse.jnosql.diana.cassandra.column;

import jakarta.nosql.column.ColumnFamilyManager;
import jakarta.nosql.column.ColumnFamilyManagerFactory;
import jakarta.nosql.tck.communication.driver.column.ColumnFamilyManagerSupplier;

public class CassandraColumnFamilyManagerSupplier implements ColumnFamilyManagerSupplier {

private static final String KEY_SPACE = "newKeySpace";

@Override
public ColumnFamilyManager get() {
ColumnFamilyManagerFactory factory = ManagerFactorySupplier.INSTANCE.get();
return factory.get(KEY_SPACE);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public void shouldReturnErrorWhenUpdateWithColumnsNull() {
}

@Test
public void shouldReturnErrorWhenUpdatetWithColumnNull() {
public void shouldReturnErrorWhenUpdateWithColumnNull() {
assertThrows(NullPointerException.class, () -> {
entityManager.update((ColumnEntity) null);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.eclipse.jnosql.diana.cassandra.column.CassandraColumnFamilyManagerSupplier
3 changes: 3 additions & 0 deletions cassandra-driver/src/test/resources/column.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
query.1=insert person {"id": 1, "name": "Diana"}
query.2=insert person {"id": 2, "name": "Artemis"}
id.name=id
3 changes: 3 additions & 0 deletions cassandra-driver/src/test/resources/column_ttl.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
query.1=insert person {"id": 1,"name":"Ada Lovelace"} 1 second
query.2=insert person {"id": 2,"name":"Poliana"} 1 second
id.name=id
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ cassandra.query-2=CREATE TYPE IF NOT EXISTS newKeySpace.fullname ( firstname tex
cassandra.query-3=CREATE COLUMNFAMILY IF NOT EXISTS newKeySpace.newColumnFamily (id bigint PRIMARY KEY, version double, options list<int>, name text);
cassandra.query-4=CREATE COLUMNFAMILY IF NOT EXISTS newKeySpace.users ( nickname text PRIMARY KEY, name frozen <fullname>);
cassandra.query-5=CREATE COLUMNFAMILY IF NOT EXISTS newKeySpace.history ( name text PRIMARY KEY, dataStart date, dateEnd timestamp);
cassandra.query-6=CREATE COLUMNFAMILY IF NOT EXISTS newKeySpace.contacts ( user text PRIMARY KEY, names list<frozen <fullname>>);
cassandra.query-6=CREATE COLUMNFAMILY IF NOT EXISTS newKeySpace.contacts ( user text PRIMARY KEY, names list<frozen <fullname>>);
cassandra.query-7=CREATE COLUMNFAMILY IF NOT EXISTS newKeySpace.person ( id bigint PRIMARY KEY, name text);
29 changes: 29 additions & 0 deletions couchbase-driver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,34 @@
<artifactId>java-client</artifactId>
<version>2.7.15</version>
</dependency>
<dependency>
<groupId>jakarta.nosql.tck.communication.driver</groupId>
<artifactId>driver-tck-key-value</artifactId>
<version>${jakarta.nosql.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.nosql.tck.communication.driver</groupId>
<artifactId>driver-tck-document</artifactId>
<version>${jakarta.nosql.version}</version>
<scope>test</scope>
</dependency>
</dependencies>


<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration>
<dependenciesToScan>
<dependency>jakarta.nosql.tck.communication.driver:driver-tck-key-value</dependency>
<dependency>jakarta.nosql.tck.communication.driver:driver-tck-document</dependency>
</dependenciesToScan>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2020 Otávio Santana and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.
*
* You may elect to redistribute this code under either of these licenses.
*
* Contributors:
*
* Otavio Santana
*/
package org.eclipse.jnosql.diana.couchbase.document;

import jakarta.nosql.document.DocumentCollectionManager;
import jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier;
import org.eclipse.jnosql.diana.couchbase.CouchbaseUtil;
import org.eclipse.jnosql.diana.couchbase.configuration.CouchbaseDocumentTcConfiguration;

public class CoucbaseDocumentCollectionManagerSupplier implements DocumentCollectionManagerSupplier {


@Override
public DocumentCollectionManager get() {
CouchbaseDocumentConfiguration configuration = CouchbaseDocumentTcConfiguration.getTcConfiguration();
CouhbaseDocumentCollectionManagerFactory managerFactory = configuration.get();
return managerFactory.get(CouchbaseUtil.BUCKET_NAME);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2020 Otávio Santana and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.
*
* You may elect to redistribute this code under either of these licenses.
*
* Contributors:
*
* Otavio Santana
*/
package org.eclipse.jnosql.diana.couchbase.keyvalue;

import jakarta.nosql.keyvalue.BucketManager;
import jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier;
import org.eclipse.jnosql.diana.couchbase.CouchbaseUtil;
import org.eclipse.jnosql.diana.couchbase.configuration.CouchbaseKeyValueTcConfiguration;

public class CouchbaseBucketManagerSupplier implements BucketManagerSupplier {

@Override
public BucketManager get() {
CouchbaseKeyValueConfiguration configuration = CouchbaseKeyValueTcConfiguration.getTcConfiguration();
final CouchbaseBucketManagerFactory factory = configuration.get();
return factory.getBucketManager(CouchbaseUtil.BUCKET_NAME);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.eclipse.jnosql.diana.couchbase.document.CoucbaseDocumentCollectionManagerSupplier
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.eclipse.jnosql.diana.couchbase.keyvalue.CouchbaseBucketManagerSupplier
3 changes: 3 additions & 0 deletions couchbase-driver/src/test/resources/document.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
query.1=insert person {"_id": 1, "name": "Diana"}
query.2=insert person {"_id": 2, "name": "Artemis"}
id.name=_id
3 changes: 3 additions & 0 deletions couchbase-driver/src/test/resources/document_ttl.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
query.1=insert person {"_id": 1, "name": "Diana"} 1 second
query.2=insert person {"_id": 2, "name": "Artemis"} 1 second
id.name=_id
20 changes: 20 additions & 0 deletions couchdb-driver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,25 @@
<version>1.8.0-beta4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.nosql.tck.communication.driver</groupId>
<artifactId>driver-tck-document</artifactId>
<version>${jakarta.nosql.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration>
<dependenciesToScan>
<dependency>jakarta.nosql.tck.communication.driver:driver-tck-document</dependency>
</dependenciesToScan>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2020 Otávio Santana and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.
*
* You may elect to redistribute this code under either of these licenses.
*
* Contributors:
*
* Otavio Santana
*/
package org.eclipse.jnosql.diana.couchdb.document;

import jakarta.nosql.document.DocumentCollectionManager;
import jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier;
import org.eclipse.jnosql.diana.couchdb.document.configuration.CouchDBDocumentTcConfiguration;

public class CouchDBDocumentCollectionManagerSupplier implements DocumentCollectionManagerSupplier {

private static final String DATABASE = "tck-database";

@Override
public DocumentCollectionManager get() {
final CouchDBDocumentCollectionManagerFactory factory = CouchDBDocumentTcConfiguration.INSTANCE.get();
return factory.get(DATABASE);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.eclipse.jnosql.diana.couchdb.document.CouchDBDocumentCollectionManagerSupplier
3 changes: 3 additions & 0 deletions couchdb-driver/src/test/resources/document.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
query.1=insert person {"_id": "1", "name": "Diana"}
query.2=insert person {"_id": "2", "name": "Artemis"}
id.name=_id
Loading

0 comments on commit 1c9b90f

Please sign in to comment.