diff --git a/arangodb-driver/pom.xml b/arangodb-driver/pom.xml index 4085594a3..9ce4a5fe3 100644 --- a/arangodb-driver/pom.xml +++ b/arangodb-driver/pom.xml @@ -28,7 +28,7 @@ The Eclipse JNoSQL communication layer, Diana, to AranboDB - 6.6.2 + 6.6.3 @@ -51,5 +51,33 @@ arangodb-java-driver ${arango.driver} + + jakarta.nosql.tck.communication.driver + driver-tck-key-value + ${jakarta.nosql.version} + test + + + jakarta.nosql.tck.communication.driver + driver-tck-document + ${jakarta.nosql.version} + test + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + + jakarta.nosql.tck.communication.driver:driver-tck-key-value + jakarta.nosql.tck.communication.driver:driver-tck-document + + + + + diff --git a/arangodb-driver/src/main/java/org/eclipse/jnosql/diana/arangodb/document/ArangoDBDocumentCollectionManagerFactory.java b/arangodb-driver/src/main/java/org/eclipse/jnosql/diana/arangodb/document/ArangoDBDocumentCollectionManagerFactory.java index ed0af920e..bb563560d 100644 --- a/arangodb-driver/src/main/java/org/eclipse/jnosql/diana/arangodb/document/ArangoDBDocumentCollectionManagerFactory.java +++ b/arangodb-driver/src/main/java/org/eclipse/jnosql/diana/arangodb/document/ArangoDBDocumentCollectionManagerFactory.java @@ -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; diff --git a/arangodb-driver/src/test/java/org/eclipse/jnosql/diana/arangodb/document/ArangoDBDocumentCollectionManagerSupplier.java b/arangodb-driver/src/test/java/org/eclipse/jnosql/diana/arangodb/document/ArangoDBDocumentCollectionManagerSupplier.java new file mode 100644 index 000000000..ea2e69d5b --- /dev/null +++ b/arangodb-driver/src/test/java/org/eclipse/jnosql/diana/arangodb/document/ArangoDBDocumentCollectionManagerSupplier.java @@ -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); + } + +} diff --git a/arangodb-driver/src/test/java/org/eclipse/jnosql/diana/arangodb/keyvalue/ArangoDBBucketManagerSupplier.java b/arangodb-driver/src/test/java/org/eclipse/jnosql/diana/arangodb/keyvalue/ArangoDBBucketManagerSupplier.java new file mode 100644 index 000000000..b1c23b050 --- /dev/null +++ b/arangodb-driver/src/test/java/org/eclipse/jnosql/diana/arangodb/keyvalue/ArangoDBBucketManagerSupplier.java @@ -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); + } +} diff --git a/arangodb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier b/arangodb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier new file mode 100644 index 000000000..8525be035 --- /dev/null +++ b/arangodb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.diana.arangodb.document.ArangoDBDocumentCollectionManagerSupplier \ No newline at end of file diff --git a/arangodb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier b/arangodb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier new file mode 100644 index 000000000..385774f5c --- /dev/null +++ b/arangodb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.diana.arangodb.keyvalue.ArangoDBBucketManagerSupplier \ No newline at end of file diff --git a/arangodb-driver/src/test/resources/document.properties b/arangodb-driver/src/test/resources/document.properties new file mode 100644 index 000000000..d9625b9a3 --- /dev/null +++ b/arangodb-driver/src/test/resources/document.properties @@ -0,0 +1,3 @@ +query.1=insert person {"_id": 1, "name": "Diana"} +query.2=insert person {"_id": 2, "name": "Artemis"} +id.name=_id \ No newline at end of file diff --git a/cassandra-driver/pom.xml b/cassandra-driver/pom.xml index 25c023ceb..7eb81ee9a 100644 --- a/cassandra-driver/pom.xml +++ b/cassandra-driver/pom.xml @@ -51,5 +51,26 @@ java-driver-query-builder ${casandra.driver.version} + + jakarta.nosql.tck.communication.driver + driver-tck-column + ${jakarta.nosql.version} + test + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + + jakarta.nosql.tck.communication.driver:driver-tck-column + + + + + diff --git a/cassandra-driver/src/test/java/org/eclipse/jnosql/diana/cassandra/column/CassandraColumnFamilyManagerSupplier.java b/cassandra-driver/src/test/java/org/eclipse/jnosql/diana/cassandra/column/CassandraColumnFamilyManagerSupplier.java new file mode 100644 index 000000000..3958ea05f --- /dev/null +++ b/cassandra-driver/src/test/java/org/eclipse/jnosql/diana/cassandra/column/CassandraColumnFamilyManagerSupplier.java @@ -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); + } + +} diff --git a/cassandra-driver/src/test/java/org/eclipse/jnosql/diana/cassandra/column/CassandraColumnFamilyManagerTest.java b/cassandra-driver/src/test/java/org/eclipse/jnosql/diana/cassandra/column/CassandraColumnFamilyManagerTest.java index 8aa87d398..9885a77a5 100644 --- a/cassandra-driver/src/test/java/org/eclipse/jnosql/diana/cassandra/column/CassandraColumnFamilyManagerTest.java +++ b/cassandra-driver/src/test/java/org/eclipse/jnosql/diana/cassandra/column/CassandraColumnFamilyManagerTest.java @@ -171,7 +171,7 @@ public void shouldReturnErrorWhenUpdateWithColumnsNull() { } @Test - public void shouldReturnErrorWhenUpdatetWithColumnNull() { + public void shouldReturnErrorWhenUpdateWithColumnNull() { assertThrows(NullPointerException.class, () -> { entityManager.update((ColumnEntity) null); }); diff --git a/cassandra-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.column.ColumnFamilyManagerSupplier b/cassandra-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.column.ColumnFamilyManagerSupplier new file mode 100644 index 000000000..a69214a19 --- /dev/null +++ b/cassandra-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.column.ColumnFamilyManagerSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.diana.cassandra.column.CassandraColumnFamilyManagerSupplier \ No newline at end of file diff --git a/cassandra-driver/src/test/resources/column.properties b/cassandra-driver/src/test/resources/column.properties new file mode 100644 index 000000000..4312788fd --- /dev/null +++ b/cassandra-driver/src/test/resources/column.properties @@ -0,0 +1,3 @@ +query.1=insert person {"id": 1, "name": "Diana"} +query.2=insert person {"id": 2, "name": "Artemis"} +id.name=id \ No newline at end of file diff --git a/cassandra-driver/src/test/resources/column_ttl.properties b/cassandra-driver/src/test/resources/column_ttl.properties new file mode 100644 index 000000000..44c606cd1 --- /dev/null +++ b/cassandra-driver/src/test/resources/column_ttl.properties @@ -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 \ No newline at end of file diff --git a/cassandra-driver/src/test/resources/diana-cassandra.properties b/cassandra-driver/src/test/resources/diana-cassandra.properties index 02308d060..7ae4fc6a0 100644 --- a/cassandra-driver/src/test/resources/diana-cassandra.properties +++ b/cassandra-driver/src/test/resources/diana-cassandra.properties @@ -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, name text); cassandra.query-4=CREATE COLUMNFAMILY IF NOT EXISTS newKeySpace.users ( nickname text PRIMARY KEY, name frozen ); 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>); \ No newline at end of file +cassandra.query-6=CREATE COLUMNFAMILY IF NOT EXISTS newKeySpace.contacts ( user text PRIMARY KEY, names list>); +cassandra.query-7=CREATE COLUMNFAMILY IF NOT EXISTS newKeySpace.person ( id bigint PRIMARY KEY, name text); \ No newline at end of file diff --git a/couchbase-driver/pom.xml b/couchbase-driver/pom.xml index 0a2b22ce9..5eb445f0c 100644 --- a/couchbase-driver/pom.xml +++ b/couchbase-driver/pom.xml @@ -51,5 +51,34 @@ java-client 2.7.15 + + jakarta.nosql.tck.communication.driver + driver-tck-key-value + ${jakarta.nosql.version} + test + + + jakarta.nosql.tck.communication.driver + driver-tck-document + ${jakarta.nosql.version} + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + + jakarta.nosql.tck.communication.driver:driver-tck-key-value + jakarta.nosql.tck.communication.driver:driver-tck-document + + + + + diff --git a/couchbase-driver/src/test/java/org/eclipse/jnosql/diana/couchbase/document/CoucbaseDocumentCollectionManagerSupplier.java b/couchbase-driver/src/test/java/org/eclipse/jnosql/diana/couchbase/document/CoucbaseDocumentCollectionManagerSupplier.java new file mode 100644 index 000000000..1516eeb9e --- /dev/null +++ b/couchbase-driver/src/test/java/org/eclipse/jnosql/diana/couchbase/document/CoucbaseDocumentCollectionManagerSupplier.java @@ -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); + } + +} diff --git a/couchbase-driver/src/test/java/org/eclipse/jnosql/diana/couchbase/keyvalue/CouchbaseBucketManagerSupplier.java b/couchbase-driver/src/test/java/org/eclipse/jnosql/diana/couchbase/keyvalue/CouchbaseBucketManagerSupplier.java new file mode 100644 index 000000000..ef4e36056 --- /dev/null +++ b/couchbase-driver/src/test/java/org/eclipse/jnosql/diana/couchbase/keyvalue/CouchbaseBucketManagerSupplier.java @@ -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); + } +} diff --git a/couchbase-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier b/couchbase-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier new file mode 100644 index 000000000..2ef54bb95 --- /dev/null +++ b/couchbase-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.diana.couchbase.document.CoucbaseDocumentCollectionManagerSupplier \ No newline at end of file diff --git a/couchbase-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier b/couchbase-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier new file mode 100644 index 000000000..1fb6b9f2e --- /dev/null +++ b/couchbase-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.diana.couchbase.keyvalue.CouchbaseBucketManagerSupplier \ No newline at end of file diff --git a/couchbase-driver/src/test/resources/document.properties b/couchbase-driver/src/test/resources/document.properties new file mode 100644 index 000000000..d9625b9a3 --- /dev/null +++ b/couchbase-driver/src/test/resources/document.properties @@ -0,0 +1,3 @@ +query.1=insert person {"_id": 1, "name": "Diana"} +query.2=insert person {"_id": 2, "name": "Artemis"} +id.name=_id \ No newline at end of file diff --git a/couchbase-driver/src/test/resources/document_ttl.properties b/couchbase-driver/src/test/resources/document_ttl.properties new file mode 100644 index 000000000..24934e0ca --- /dev/null +++ b/couchbase-driver/src/test/resources/document_ttl.properties @@ -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 \ No newline at end of file diff --git a/couchdb-driver/pom.xml b/couchdb-driver/pom.xml index ba2e5e41c..a13f0c50e 100644 --- a/couchdb-driver/pom.xml +++ b/couchdb-driver/pom.xml @@ -49,5 +49,25 @@ 1.8.0-beta4 test + + jakarta.nosql.tck.communication.driver + driver-tck-document + ${jakarta.nosql.version} + test + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + + jakarta.nosql.tck.communication.driver:driver-tck-document + + + + + diff --git a/couchdb-driver/src/test/java/org/eclipse/jnosql/diana/couchdb/document/CouchDBDocumentCollectionManagerSupplier.java b/couchdb-driver/src/test/java/org/eclipse/jnosql/diana/couchdb/document/CouchDBDocumentCollectionManagerSupplier.java new file mode 100644 index 000000000..9e7547040 --- /dev/null +++ b/couchdb-driver/src/test/java/org/eclipse/jnosql/diana/couchdb/document/CouchDBDocumentCollectionManagerSupplier.java @@ -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); + } + +} diff --git a/couchdb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier b/couchdb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier new file mode 100644 index 000000000..98e06b0d7 --- /dev/null +++ b/couchdb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.diana.couchdb.document.CouchDBDocumentCollectionManagerSupplier \ No newline at end of file diff --git a/couchdb-driver/src/test/resources/document.properties b/couchdb-driver/src/test/resources/document.properties new file mode 100644 index 000000000..575d46363 --- /dev/null +++ b/couchdb-driver/src/test/resources/document.properties @@ -0,0 +1,3 @@ +query.1=insert person {"_id": "1", "name": "Diana"} +query.2=insert person {"_id": "2", "name": "Artemis"} +id.name=_id \ No newline at end of file diff --git a/elasticsearch-driver/pom.xml b/elasticsearch-driver/pom.xml index 19a8aec82..1338e5a1f 100644 --- a/elasticsearch-driver/pom.xml +++ b/elasticsearch-driver/pom.xml @@ -46,5 +46,26 @@ elasticsearch-rest-high-level-client ${es.version} + + jakarta.nosql.tck.communication.driver + driver-tck-document + ${jakarta.nosql.version} + test + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + + jakarta.nosql.tck.communication.driver:driver-tck-document + + + + + diff --git a/elasticsearch-driver/src/test/java/org/eclipse/jnosql/diana/elasticsearch/document/ElasticsearchDocumentCollectionManagerSupplier.java b/elasticsearch-driver/src/test/java/org/eclipse/jnosql/diana/elasticsearch/document/ElasticsearchDocumentCollectionManagerSupplier.java new file mode 100644 index 000000000..54eff26e2 --- /dev/null +++ b/elasticsearch-driver/src/test/java/org/eclipse/jnosql/diana/elasticsearch/document/ElasticsearchDocumentCollectionManagerSupplier.java @@ -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.elasticsearch.document; + +import jakarta.nosql.document.DocumentCollectionManager; +import jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier; + +public class ElasticsearchDocumentCollectionManagerSupplier implements DocumentCollectionManagerSupplier { + + private static final String DATABASE = "tck-database"; + + @Override + public DocumentCollectionManager get() { + final ElasticsearchDocumentCollectionManagerFactory factory = ElasticsearchDocumentCollectionManagerFactorySupplier.INSTANCE.get(); + return factory.get(DATABASE); + } + +} diff --git a/elasticsearch-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier b/elasticsearch-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier new file mode 100644 index 000000000..05bf81123 --- /dev/null +++ b/elasticsearch-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.diana.elasticsearch.document.ElasticsearchDocumentCollectionManagerSupplier \ No newline at end of file diff --git a/elasticsearch-driver/src/test/resources/document.properties b/elasticsearch-driver/src/test/resources/document.properties new file mode 100644 index 000000000..d9625b9a3 --- /dev/null +++ b/elasticsearch-driver/src/test/resources/document.properties @@ -0,0 +1,3 @@ +query.1=insert person {"_id": 1, "name": "Diana"} +query.2=insert person {"_id": 2, "name": "Artemis"} +id.name=_id \ No newline at end of file diff --git a/hazelcast-driver/pom.xml b/hazelcast-driver/pom.xml index 301e00bc3..0d83fbd04 100644 --- a/hazelcast-driver/pom.xml +++ b/hazelcast-driver/pom.xml @@ -40,7 +40,28 @@ com.hazelcast hazelcast - 3.12 + 3.12.7 + + + jakarta.nosql.tck.communication.driver + driver-tck-key-value + ${jakarta.nosql.version} + test + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + + jakarta.nosql.tck.communication.driver:driver-tck-key-value + + + + + diff --git a/hazelcast-driver/src/test/java/org/eclipse/jnosql/diana/hazelcast/keyvalue/HazelcastBucketManagerSupplier.java b/hazelcast-driver/src/test/java/org/eclipse/jnosql/diana/hazelcast/keyvalue/HazelcastBucketManagerSupplier.java new file mode 100644 index 000000000..14b5e8cf9 --- /dev/null +++ b/hazelcast-driver/src/test/java/org/eclipse/jnosql/diana/hazelcast/keyvalue/HazelcastBucketManagerSupplier.java @@ -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.hazelcast.keyvalue; + +import jakarta.nosql.keyvalue.BucketManager; +import jakarta.nosql.keyvalue.BucketManagerFactory; +import jakarta.nosql.keyvalue.KeyValueConfiguration; +import jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier; + +public class HazelcastBucketManagerSupplier implements BucketManagerSupplier { + + private static final String BUCKET = "tck-users-entity"; + + @Override + public BucketManager get() { + KeyValueConfiguration configuration = new HazelcastKeyValueConfiguration(); + final BucketManagerFactory factory = configuration.get(); + return factory.getBucketManager(BUCKET); + } +} diff --git a/hazelcast-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier b/hazelcast-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier new file mode 100644 index 000000000..9c4ec5c0f --- /dev/null +++ b/hazelcast-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.diana.hazelcast.keyvalue.HazelcastBucketManagerSupplier \ No newline at end of file diff --git a/hbase-driver/pom.xml b/hbase-driver/pom.xml index 2c7b1407e..6e4b91fbb 100644 --- a/hbase-driver/pom.xml +++ b/hbase-driver/pom.xml @@ -35,7 +35,28 @@ org.apache.hbase hbase-client - 1.4.3 + 2.2.4 + + + jakarta.nosql.tck.communication.driver + driver-tck-column + ${jakarta.nosql.version} + test + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + + jakarta.nosql.tck.communication.driver:driver-tck-column + + + + + diff --git a/hbase-driver/src/main/java/org/eclipse/jnosql/diana/hbase/column/HBaseColumnFamilyManagerFactory.java b/hbase-driver/src/main/java/org/eclipse/jnosql/diana/hbase/column/HBaseColumnFamilyManagerFactory.java index 0bfd828aa..f2e19d042 100644 --- a/hbase-driver/src/main/java/org/eclipse/jnosql/diana/hbase/column/HBaseColumnFamilyManagerFactory.java +++ b/hbase-driver/src/main/java/org/eclipse/jnosql/diana/hbase/column/HBaseColumnFamilyManagerFactory.java @@ -17,13 +17,15 @@ import jakarta.nosql.column.ColumnFamilyManagerFactory; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HColumnDescriptor; -import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; +import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; +import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.ConnectionFactory; import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.client.TableDescriptor; +import org.apache.hadoop.hbase.client.TableDescriptorBuilder; import java.io.IOException; import java.util.Arrays; @@ -61,17 +63,26 @@ public HBaseColumnFamilyManager get(String database) { private void existTable(Admin admin, TableName tableName) throws IOException { - HTableDescriptor tableDescriptor = admin.getTableDescriptor(tableName); - HColumnDescriptor[] columnFamilies = tableDescriptor.getColumnFamilies(); - List familiesExist = Arrays.stream(columnFamilies).map(HColumnDescriptor::getName).map(String::new).collect(Collectors.toList()); - families.stream().filter(s -> !familiesExist.contains(s)).map(HColumnDescriptor::new).forEach(tableDescriptor::addFamily); - admin.modifyTable(tableName, tableDescriptor); + TableDescriptor tableDescriptor = admin.getDescriptor(tableName); + ColumnFamilyDescriptor[] columnFamilies = tableDescriptor.getColumnFamilies(); + final TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName); + List familiesExist = Arrays.stream(columnFamilies).map(ColumnFamilyDescriptor::getName).map(String::new).collect(Collectors.toList()); + if (familiesExist.size() != families.size()) { + families.stream().filter(s -> !familiesExist.contains(s)) + .forEach(s -> builder.setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(s.getBytes()) + .build())); + final TableDescriptor descriptor = builder.build(); + admin.modifyTable(descriptor); + } + } private void createTable(Admin admin, TableName tableName) throws IOException { - HTableDescriptor desc = new HTableDescriptor(tableName); - families.stream().map(HColumnDescriptor::new).forEach(desc::addFamily); - admin.createTable(desc); + final TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName); + families.stream().forEach(s -> builder.setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(s.getBytes()) + .build())); + final TableDescriptor descriptor = builder.build(); + admin.createTable(descriptor); } @Override diff --git a/hbase-driver/src/test/java/org/eclipse/jnosql/diana/hbase/column/HBaseColumnFamilyManagerSupplier.java b/hbase-driver/src/test/java/org/eclipse/jnosql/diana/hbase/column/HBaseColumnFamilyManagerSupplier.java new file mode 100644 index 000000000..286f5bcdc --- /dev/null +++ b/hbase-driver/src/test/java/org/eclipse/jnosql/diana/hbase/column/HBaseColumnFamilyManagerSupplier.java @@ -0,0 +1,33 @@ +/* + * 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.hbase.column; + +import jakarta.nosql.column.ColumnFamilyManager; +import jakarta.nosql.tck.communication.driver.column.ColumnFamilyManagerSupplier; + +public class HBaseColumnFamilyManagerSupplier implements ColumnFamilyManagerSupplier { + + private static final String DATABASE = "tck-database"; + public static final String FAMILY = "person"; + + @Override + public ColumnFamilyManager get() { + HBaseColumnConfiguration configuration = new HBaseColumnConfiguration(); + configuration.add(FAMILY); + final HBaseColumnFamilyManagerFactory factory = configuration.get(); + return factory.get(DATABASE); + } + +} diff --git a/hbase-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.column.ColumnFamilyManagerSupplier b/hbase-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.column.ColumnFamilyManagerSupplier new file mode 100644 index 000000000..ff7fae1d8 --- /dev/null +++ b/hbase-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.column.ColumnFamilyManagerSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.diana.hbase.column.HBaseColumnFamilyManagerSupplier \ No newline at end of file diff --git a/hbase-driver/src/test/resources/column.properties b/hbase-driver/src/test/resources/column.properties new file mode 100644 index 000000000..d9625b9a3 --- /dev/null +++ b/hbase-driver/src/test/resources/column.properties @@ -0,0 +1,3 @@ +query.1=insert person {"_id": 1, "name": "Diana"} +query.2=insert person {"_id": 2, "name": "Artemis"} +id.name=_id \ No newline at end of file diff --git a/infinispan-driver/pom.xml b/infinispan-driver/pom.xml index 40a1f1b7a..e1268ae61 100644 --- a/infinispan-driver/pom.xml +++ b/infinispan-driver/pom.xml @@ -26,7 +26,7 @@ The Eclipse JNoSQL communication layer, Diana, implementation for Infinispan - 10.1.1.Final + 10.1.8.Final @@ -54,5 +54,26 @@ infinispan-embedded 9.1.7.Final + + jakarta.nosql.tck.communication.driver + driver-tck-key-value + ${jakarta.nosql.version} + test + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + + jakarta.nosql.tck.communication.driver:driver-tck-key-value + + + + + diff --git a/infinispan-driver/src/test/java/org/eclipse/jnosql/diana/infinispan/keyvalue/InfinispanBucketManagerSupplier.java b/infinispan-driver/src/test/java/org/eclipse/jnosql/diana/infinispan/keyvalue/InfinispanBucketManagerSupplier.java new file mode 100644 index 000000000..3ef7996a4 --- /dev/null +++ b/infinispan-driver/src/test/java/org/eclipse/jnosql/diana/infinispan/keyvalue/InfinispanBucketManagerSupplier.java @@ -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.infinispan.keyvalue; + +import jakarta.nosql.keyvalue.BucketManager; +import jakarta.nosql.keyvalue.BucketManagerFactory; +import jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier; +import org.eclipse.jnosql.diana.infinispan.keyvalue.util.KeyValueEntityManagerFactoryUtils; + +public class InfinispanBucketManagerSupplier implements BucketManagerSupplier { + + private static final String BUCKET = "tck-users-entity"; + + @Override + public BucketManager get() { + final BucketManagerFactory factory = KeyValueEntityManagerFactoryUtils.get(); + return factory.getBucketManager(BUCKET); + } +} diff --git a/infinispan-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier b/infinispan-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier new file mode 100644 index 000000000..112dacce7 --- /dev/null +++ b/infinispan-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.diana.infinispan.keyvalue.InfinispanBucketManagerSupplier \ No newline at end of file diff --git a/infinispan-driver/src/test/resources/diana-infinispan.properties b/infinispan-driver/src/test/resources/diana-infinispan.properties index baa807cb2..a1616096d 100644 --- a/infinispan-driver/src/test/resources/diana-infinispan.properties +++ b/infinispan-driver/src/test/resources/diana-infinispan.properties @@ -1,15 +1 @@ -# Copyright (c) 2017 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: -# -# The Infinispan Team -# infinispan.config=infinispan.xml -#infinispan- diff --git a/infinispan-driver/src/test/resources/infinispan.xml b/infinispan-driver/src/test/resources/infinispan.xml index a76503f6f..7573bd274 100644 --- a/infinispan-driver/src/test/resources/infinispan.xml +++ b/infinispan-driver/src/test/resources/infinispan.xml @@ -12,9 +12,13 @@ The Infinispan Team --> - + - + + + + + diff --git a/memcached-driver/pom.xml b/memcached-driver/pom.xml index c4db4f066..87e3bd384 100644 --- a/memcached-driver/pom.xml +++ b/memcached-driver/pom.xml @@ -42,5 +42,26 @@ spymemcached 2.12.3 + + jakarta.nosql.tck.communication.driver + driver-tck-key-value + ${jakarta.nosql.version} + test + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + + jakarta.nosql.tck.communication.driver:driver-tck-key-value + + + + + diff --git a/memcached-driver/src/test/java/org/eclipse/jnosql/diana/memcached/keyvalue/MemcachedBucketManagerSupplier.java b/memcached-driver/src/test/java/org/eclipse/jnosql/diana/memcached/keyvalue/MemcachedBucketManagerSupplier.java new file mode 100644 index 000000000..83ff10002 --- /dev/null +++ b/memcached-driver/src/test/java/org/eclipse/jnosql/diana/memcached/keyvalue/MemcachedBucketManagerSupplier.java @@ -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.memcached.keyvalue; + +import jakarta.nosql.keyvalue.BucketManager; +import jakarta.nosql.keyvalue.BucketManagerFactory; +import jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier; + +public class MemcachedBucketManagerSupplier implements BucketManagerSupplier { + + private static final String BUCKET = "tck-users-entity"; + + @Override + public BucketManager get() { + final BucketManagerFactory factory = BucketManagerFactorySupplier.INSTANCE.get(); + return factory.getBucketManager(BUCKET); + } +} diff --git a/memcached-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier b/memcached-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier new file mode 100644 index 000000000..605c83c06 --- /dev/null +++ b/memcached-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.diana.memcached.keyvalue.MemcachedBucketManagerSupplier \ No newline at end of file diff --git a/mongodb-driver/pom.xml b/mongodb-driver/pom.xml index e4a774ea7..daf944175 100644 --- a/mongodb-driver/pom.xml +++ b/mongodb-driver/pom.xml @@ -45,5 +45,26 @@ mongodb-driver-sync ${monbodb.driver} + + jakarta.nosql.tck.communication.driver + driver-tck-document + ${jakarta.nosql.version} + test + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + + jakarta.nosql.tck.communication.driver:driver-tck-document + + + + + diff --git a/mongodb-driver/src/test/java/org/eclipse/jnosql/diana/mongodb/document/MongoDBDocumentCollectionManagerSupplier.java b/mongodb-driver/src/test/java/org/eclipse/jnosql/diana/mongodb/document/MongoDBDocumentCollectionManagerSupplier.java new file mode 100644 index 000000000..50dd70a82 --- /dev/null +++ b/mongodb-driver/src/test/java/org/eclipse/jnosql/diana/mongodb/document/MongoDBDocumentCollectionManagerSupplier.java @@ -0,0 +1,29 @@ +/* + * 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.mongodb.document; + +import jakarta.nosql.document.DocumentCollectionManager; +import jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier; + +public class MongoDBDocumentCollectionManagerSupplier implements DocumentCollectionManagerSupplier { + + private static final String DATABASE = "tck-database"; + + @Override + public DocumentCollectionManager get() { + return ManagerFactorySupplier.INSTANCE.get(DATABASE); + } + +} diff --git a/mongodb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier b/mongodb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier new file mode 100644 index 000000000..6b1cfbbe8 --- /dev/null +++ b/mongodb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.diana.mongodb.document.MongoDBDocumentCollectionManagerSupplier \ No newline at end of file diff --git a/mongodb-driver/src/test/resources/document.properties b/mongodb-driver/src/test/resources/document.properties new file mode 100644 index 000000000..d9625b9a3 --- /dev/null +++ b/mongodb-driver/src/test/resources/document.properties @@ -0,0 +1,3 @@ +query.1=insert person {"_id": 1, "name": "Diana"} +query.2=insert person {"_id": 2, "name": "Artemis"} +id.name=_id \ No newline at end of file diff --git a/orientdb-driver/pom.xml b/orientdb-driver/pom.xml index 8d2b2d0bb..3962a9a03 100644 --- a/orientdb-driver/pom.xml +++ b/orientdb-driver/pom.xml @@ -48,5 +48,26 @@ diana-document ${project.version} + + jakarta.nosql.tck.communication.driver + driver-tck-document + ${jakarta.nosql.version} + test + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + + jakarta.nosql.tck.communication.driver:driver-tck-document + + + + + diff --git a/orientdb-driver/src/test/java/org/eclipse/jnosql/diana/orientdb/document/OrientDBDocumentCollectionManagerSupplier.java b/orientdb-driver/src/test/java/org/eclipse/jnosql/diana/orientdb/document/OrientDBDocumentCollectionManagerSupplier.java new file mode 100644 index 000000000..3eb4c0618 --- /dev/null +++ b/orientdb-driver/src/test/java/org/eclipse/jnosql/diana/orientdb/document/OrientDBDocumentCollectionManagerSupplier.java @@ -0,0 +1,29 @@ +/* + * 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.orientdb.document; + +import jakarta.nosql.document.DocumentCollectionManager; +import jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier; + +public class OrientDBDocumentCollectionManagerSupplier implements DocumentCollectionManagerSupplier { + + private static final String DATABASE = "tck-database"; + + @Override + public DocumentCollectionManager get() { + return DocumentConfigurationUtils.get().get(Database.DATABASE); + } + +} diff --git a/orientdb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier b/orientdb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier new file mode 100644 index 000000000..0d695b8da --- /dev/null +++ b/orientdb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.diana.orientdb.document.OrientDBDocumentCollectionManagerSupplier \ No newline at end of file diff --git a/orientdb-driver/src/test/resources/document.properties b/orientdb-driver/src/test/resources/document.properties new file mode 100644 index 000000000..d9625b9a3 --- /dev/null +++ b/orientdb-driver/src/test/resources/document.properties @@ -0,0 +1,3 @@ +query.1=insert person {"_id": 1, "name": "Diana"} +query.2=insert person {"_id": 2, "name": "Artemis"} +id.name=_id \ No newline at end of file diff --git a/ravendb-driver/pom.xml b/ravendb-driver/pom.xml index 72831a9a0..87487de73 100644 --- a/ravendb-driver/pom.xml +++ b/ravendb-driver/pom.xml @@ -45,5 +45,26 @@ ravendb-client 4.0.0-rc1 + + jakarta.nosql.tck.communication.driver + driver-tck-document + ${jakarta.nosql.version} + test + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + + jakarta.nosql.tck.communication.driver:driver-tck-document + + + + + diff --git a/ravendb-driver/src/main/java/org/eclipse/jnosql/diana/ravendb/document/DocumentQueryConversor.java b/ravendb-driver/src/main/java/org/eclipse/jnosql/diana/ravendb/document/DocumentQueryConversor.java index ce563db1d..5512458be 100644 --- a/ravendb-driver/src/main/java/org/eclipse/jnosql/diana/ravendb/document/DocumentQueryConversor.java +++ b/ravendb-driver/src/main/java/org/eclipse/jnosql/diana/ravendb/document/DocumentQueryConversor.java @@ -43,7 +43,6 @@ public static QueryResult createQuery(IDocumentSession session, DocumentQuery qu IDocumentQuery ravenQuery = session.query(HashMap.class, Query.collection(query.getDocumentCollection())); query.getCondition().ifPresent(c -> feedQuery(ravenQuery, c, ids)); - if (!ids.isEmpty() && query.getCondition().isPresent()) { return new QueryResult(ids, null); } else { @@ -81,7 +80,12 @@ private static void feedQuery(IDocumentQuery ravenQuery, DocumentCondit String name = document.getName(); if (EntityConverter.ID_FIELD.equals(name)) { - ids.add(value.toString()); + if (value instanceof Iterable) { + final Iterable iterable = Iterable.class.cast(value); + iterable.forEach(i -> ids.add(i.toString())); + } else { + ids.add(value.toString()); + } return; } diff --git a/ravendb-driver/src/main/java/org/eclipse/jnosql/diana/ravendb/document/EntityConverter.java b/ravendb-driver/src/main/java/org/eclipse/jnosql/diana/ravendb/document/EntityConverter.java index 02231f530..e168b340f 100644 --- a/ravendb-driver/src/main/java/org/eclipse/jnosql/diana/ravendb/document/EntityConverter.java +++ b/ravendb-driver/src/main/java/org/eclipse/jnosql/diana/ravendb/document/EntityConverter.java @@ -35,10 +35,12 @@ final class EntityConverter { private EntityConverter() { } - - public static String getId(Map entity) { - Map metadata = (Map) entity.remove(Constants.Documents.Metadata.KEY); - return (String) metadata.get(Constants.Documents.Metadata.ID); + public static String getId(Map entity) { + if (entity != null) { + Map metadata = (Map) entity.remove(Constants.Documents.Metadata.KEY); + return (String) metadata.get(Constants.Documents.Metadata.ID); + } + return ""; } static DocumentEntity getEntity(Map map) { diff --git a/ravendb-driver/src/test/java/org/eclipse/jnosql/diana/ravendb/document/RavenDBDocumentCollectionManagerSupplier.java b/ravendb-driver/src/test/java/org/eclipse/jnosql/diana/ravendb/document/RavenDBDocumentCollectionManagerSupplier.java new file mode 100644 index 000000000..c745d3d7d --- /dev/null +++ b/ravendb-driver/src/test/java/org/eclipse/jnosql/diana/ravendb/document/RavenDBDocumentCollectionManagerSupplier.java @@ -0,0 +1,27 @@ +/* + * 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.ravendb.document; + +import jakarta.nosql.document.DocumentCollectionManager; +import jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier; + +public class RavenDBDocumentCollectionManagerSupplier implements DocumentCollectionManagerSupplier { + + @Override + public DocumentCollectionManager get() { + return DocumentConfigurationUtils.INSTANCE.get().get("database"); + } + +} diff --git a/ravendb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier b/ravendb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier new file mode 100644 index 000000000..62c441f44 --- /dev/null +++ b/ravendb-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.diana.ravendb.document.RavenDBDocumentCollectionManagerSupplier \ No newline at end of file diff --git a/ravendb-driver/src/test/resources/document.properties b/ravendb-driver/src/test/resources/document.properties new file mode 100644 index 000000000..d9625b9a3 --- /dev/null +++ b/ravendb-driver/src/test/resources/document.properties @@ -0,0 +1,3 @@ +query.1=insert person {"_id": 1, "name": "Diana"} +query.2=insert person {"_id": 2, "name": "Artemis"} +id.name=_id \ No newline at end of file diff --git a/redis-driver/pom.xml b/redis-driver/pom.xml index 8b3582d6c..79f630c1a 100644 --- a/redis-driver/pom.xml +++ b/redis-driver/pom.xml @@ -34,12 +34,33 @@ redis.clients jedis - 3.2.0 + 3.3.0 ${project.groupId} diana-driver-commons ${project.version} + + jakarta.nosql.tck.communication.driver + driver-tck-key-value + ${jakarta.nosql.version} + test + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + + jakarta.nosql.tck.communication.driver:driver-tck-key-value + + + + + diff --git a/redis-driver/src/test/java/org/eclipse/jnosql/diana/redis/keyvalue/RedisBucketManagerSupplier.java b/redis-driver/src/test/java/org/eclipse/jnosql/diana/redis/keyvalue/RedisBucketManagerSupplier.java new file mode 100644 index 000000000..a73836bb6 --- /dev/null +++ b/redis-driver/src/test/java/org/eclipse/jnosql/diana/redis/keyvalue/RedisBucketManagerSupplier.java @@ -0,0 +1,29 @@ +/* + * 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.redis.keyvalue; + +import jakarta.nosql.keyvalue.BucketManager; +import jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier; + +public class RedisBucketManagerSupplier implements BucketManagerSupplier { + + private static final String BUCKET = "tck-users-entity"; + + @Override + public BucketManager get() { + final RedisBucketManagerFactory factory = RedisBucketManagerFactorySupplier.INSTANCE.get(); + return factory.getBucketManager(BUCKET); + } +} diff --git a/redis-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier b/redis-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier new file mode 100644 index 000000000..9acb29d0a --- /dev/null +++ b/redis-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.diana.redis.keyvalue.RedisBucketManagerSupplier \ No newline at end of file diff --git a/redis-driver/src/test/resources/diana-redis.properties b/redis-driver/src/test/resources/diana-redis.properties index 7420364ea..0dd67bf88 100644 --- a/redis-driver/src/test/resources/diana-redis.properties +++ b/redis-driver/src/test/resources/diana-redis.properties @@ -1,26 +1,6 @@ -# -# Copyright (c) 2017 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 -# redis.host=localhost redis.port=6379 redis.timeout=2000 -#redis-password= -#redis-database= -#redis-clientName= -#redis-slave-hoster-1=172.17.0.2 -#redis-slave-port-1=6379 -redis.max-total=1000 redis.max.idle=10 redis.min.idle=1 redis.max.wait.millis=30000 \ No newline at end of file diff --git a/riak-driver/pom.xml b/riak-driver/pom.xml index 571e1d1cb..ebfc8b881 100644 --- a/riak-driver/pom.xml +++ b/riak-driver/pom.xml @@ -44,5 +44,26 @@ riak-client 2.1.1 + + jakarta.nosql.tck.communication.driver + driver-tck-key-value + ${jakarta.nosql.version} + test + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + + jakarta.nosql.tck.communication.driver:driver-tck-key-value + + + + + diff --git a/riak-driver/src/test/java/org/eclipse/jnosql/diana/riak/keyvalue/RiakBucketManagerSupplier.java b/riak-driver/src/test/java/org/eclipse/jnosql/diana/riak/keyvalue/RiakBucketManagerSupplier.java new file mode 100644 index 000000000..81a2fed7f --- /dev/null +++ b/riak-driver/src/test/java/org/eclipse/jnosql/diana/riak/keyvalue/RiakBucketManagerSupplier.java @@ -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.riak.keyvalue; + +import jakarta.nosql.keyvalue.BucketManager; +import jakarta.nosql.keyvalue.BucketManagerFactory; +import jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier; + +public class RiakBucketManagerSupplier implements BucketManagerSupplier { + + private static final String BUCKET = "tck-users-entity"; + + @Override + public BucketManager get() { + final BucketManagerFactory factory = RiakTestUtils.get(); + return factory.getBucketManager(BUCKET); + } +} diff --git a/riak-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier b/riak-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier new file mode 100644 index 000000000..d35c52a24 --- /dev/null +++ b/riak-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.keyvalue.BucketManagerSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.diana.riak.keyvalue.RiakBucketManagerSupplier \ No newline at end of file diff --git a/solr-driver/pom.xml b/solr-driver/pom.xml index 8f6a3b94c..ad13bc39b 100644 --- a/solr-driver/pom.xml +++ b/solr-driver/pom.xml @@ -39,7 +39,28 @@ org.apache.solr solr-solrj - 8.4.1 + 8.5.1 + + + jakarta.nosql.tck.communication.driver + driver-tck-document + ${jakarta.nosql.version} + test + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + + jakarta.nosql.tck.communication.driver:driver-tck-document + + + + + diff --git a/solr-driver/src/test/java/org/eclipse/jnosql/diana/solr/document/SolrDocumentCollectionManagerSupplier.java b/solr-driver/src/test/java/org/eclipse/jnosql/diana/solr/document/SolrDocumentCollectionManagerSupplier.java new file mode 100644 index 000000000..515c6e58b --- /dev/null +++ b/solr-driver/src/test/java/org/eclipse/jnosql/diana/solr/document/SolrDocumentCollectionManagerSupplier.java @@ -0,0 +1,28 @@ +/* + * 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.solr.document; + +import jakarta.nosql.document.DocumentCollectionManager; +import jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier; + +public class SolrDocumentCollectionManagerSupplier implements DocumentCollectionManagerSupplier { + + + @Override + public DocumentCollectionManager get() { + return ManagerFactorySupplier.INSTANCE.get("database"); + } + +} diff --git a/solr-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier b/solr-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier new file mode 100644 index 000000000..5b0a617d9 --- /dev/null +++ b/solr-driver/src/test/resources/META-INF/services/jakarta.nosql.tck.communication.driver.document.DocumentCollectionManagerSupplier @@ -0,0 +1 @@ +org.eclipse.jnosql.diana.solr.document.SolrDocumentCollectionManagerSupplier \ No newline at end of file diff --git a/solr-driver/src/test/resources/document.properties b/solr-driver/src/test/resources/document.properties new file mode 100644 index 000000000..d9625b9a3 --- /dev/null +++ b/solr-driver/src/test/resources/document.properties @@ -0,0 +1,3 @@ +query.1=insert person {"_id": 1, "name": "Diana"} +query.2=insert person {"_id": 2, "name": "Artemis"} +id.name=_id \ No newline at end of file